Browse Source

Added ability to clear data

Chris Konstad 4 years ago
parent
commit
4f5af1a596
4 changed files with 21 additions and 2 deletions
  1. 2 1
      README.md
  2. 2 1
      manifest.json
  3. 11 0
      options.html
  4. 6 0
      options.js

+ 2 - 1
README.md

@ -6,4 +6,5 @@
6 6
* [ ] don't save a subreddit if it doesn't exist (URL is a search page)
7 7
* [x] don't save data when in incognito, per google guidelines
8 8
* [ ] be able to remove select subreddits from list
9
* [ ] be able to clear data
9
* [x] be able to clear data
10
* [ ] make options page nicer

+ 2 - 1
manifest.json

@ -11,5 +11,6 @@
11 11
  "permissions": [
12 12
    "storage",
13 13
    "tabs"
14
  ]
14
  ],
15
  "options_page": "options.html"
15 16
}

+ 11 - 0
options.html

@ -0,0 +1,11 @@
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <title>r/ Options</title>
5
</head>
6
<body>
7
  <button id="clear_subreddits">Clear Subreddits</button>
8

													
9
  <script src="options.js"></script>
10
</body>
11
</html>

+ 6 - 0
options.js

@ -0,0 +1,6 @@
1
function clear_subreddits() {
2
  chrome.storage.sync.clear();
3
}
4

													
5
document.getElementById("clear_subreddits").addEventListener("click",
6
  clear_subreddits);