From d878db527ce092b97dcb8f8d29d2e9456f50fdb5 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 11 Dec 2011 13:49:02 +0000 Subject: Add options to chromium extension --- chromium/background.html | 5 ++++- chromium/manifest.json | 1 + chromium/options.html | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 chromium/options.html (limited to 'chromium') diff --git a/chromium/background.html b/chromium/background.html index ce0042e..6d0847c 100644 --- a/chromium/background.html +++ b/chromium/background.html @@ -7,6 +7,9 @@ chrome.extension.onRequest.addListener(onRequest); chrome.pageAction.onClicked.addListener(function(tab) { - chrome.tabs.executeScript(tab.id, {code:"simplyread();"}); + if (!localStorage.prefs) + localStorage.prefs = '{"nostyle":false,"nolinks":false}'; + var prefs = JSON.parse(localStorage.prefs); + chrome.tabs.executeScript(tab.id, {code:"simplyread("+prefs.nostyle+","+prefs.nolinks+");"}); }); diff --git a/chromium/manifest.json b/chromium/manifest.json index 996b3e8..a0ff97b 100644 --- a/chromium/manifest.json +++ b/chromium/manifest.json @@ -2,6 +2,7 @@ "name": "SimplyRead", "version": "VERSION", "background_page": "background.html", + "options_page": "options.html", "permissions": [ "tabs", "" ], "content_scripts": [{"matches": [""], "js": ["simplyread.js", "keybind.js", "viable.js"]}], "page_action": { "default_icon": "icon.png" }, diff --git a/chromium/options.html b/chromium/options.html new file mode 100644 index 0000000..97d7f46 --- /dev/null +++ b/chromium/options.html @@ -0,0 +1,18 @@ +
+

+

+
+ -- cgit v1.2.3