Skip to content

Commit

Permalink
Add button to test writing and restoring to localStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Jan 29, 2025
1 parent 6c5a235 commit 327055c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions mink-plugin/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h3>Archival Sources</h3>
<option disabled>https://mementoweb.org</option>
<option disabled>localhost (MemGator via WAIL)</option>
</select>
<button id="test_writeToLS">Test: write aggregators to LocalStorage and reload</button>
</fieldset>

<fieldset disabled class="hidden">
Expand Down
7 changes: 7 additions & 0 deletions mink-plugin/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ function setAggregatorsInStorage (arrayOfAggregatorHostnames, cb) {
return chrome.storage.local.set({ 'aggregators': arrayOfAggregatorHostnames }).then(getAggregatorsFromStorage)
}

function test_writeToLocalStorageAndReload () {
let testAggregators = ['https://memento.example.com', 'https://aggregator.somehostname.net']
setAggregatorsInStorage(testAggregators)
}


document.addEventListener('DOMContentLoaded', restoreOptions)
document.addEventListener('DOMContentLoaded', createAddURIBinder)
Expand All @@ -360,3 +365,5 @@ document.querySelector('#clearIgnorelist').addEventListener('click', clearIgnore
document.querySelector('#doneButton').addEventListener('click', saveAndCloseOptionsPanel)
document.querySelector('#restoreDefaultsButton').addEventListener('click', restoreDefaults)

document.querySelector('#test_writeToLS').addEventListener('click', test_writeToLocalStorageAndReload)

0 comments on commit 327055c

Please sign in to comment.