Skip to content

Commit

Permalink
Add options page with button for clearing storage
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindlie committed May 11, 2020
1 parent e7f856d commit b099ec1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
}
],

"options_ui": {
"page": "options.html",
"browser_style": true
},

"browser_specific_settings": {
"gecko": {
"id": "[email protected]"
Expand Down
15 changes: 15 additions & 0 deletions options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8"/>
</head>

<body>
<form>
<label>Clear storage:</label>
<button id='btn-clear-storage'>Clear</button>
</form>
<script src="options.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const storage = browser.storage.sync;

const btnClearStorage = document.getElementById('btn-clear-storage');

btnClearStorage.onclick = e => {
storage.clear();
}

0 comments on commit b099ec1

Please sign in to comment.