From 58fa582dc8c896a647823f67209a5eebfd2b800e Mon Sep 17 00:00:00 2001 From: Adam Hughes Date: Tue, 22 Feb 2011 12:30:13 -0500 Subject: [PATCH] remove requirement for 'tabs' permissions by displaying release notes after updating instead of showing the dumb red shack icon. --- background.html | 27 ++++++++------------------- manifest.json | 3 +-- options.js | 5 ----- release_notes.html | 20 ++++++++++++++++++++ shack-new.png | Bin 715 -> 0 bytes 5 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 release_notes.html delete mode 100644 shack-new.png diff --git a/background.html b/background.html index 223cde98..6972c412 100644 --- a/background.html +++ b/background.html @@ -39,6 +39,13 @@ setSetting("enabled_scripts", scripts); } + + if (version != CURRENT_VERSION) + { + chrome.tabs.create({url: "release_notes.html"}); + } + + setSetting("version", CURRENT_VERSION); } function setSetting(name, value) @@ -62,28 +69,10 @@ function showPageAction(tabId, url) { - updatePageActionIcon(tabId, url); + chrome.pageAction.setIcon({ "tabId": tabId, "path": "shack.png" }); chrome.pageAction.show(tabId); } -function updatePageActionIcon(tabId, url) -{ - var last_version = getSetting("version", 0); - var image = (last_version < CURRENT_VERSION) ? "shack-new.png" : "shack.png"; - chrome.pageAction.setIcon({ "tabId": tabId, "path": image }); -} - -function updatePageActionIcons() -{ - chrome.windows.getAll({populate:true}, function(windows) - { - for (var i = 0; i < windows.length; i++){ - var tabs = windows[i].tabs - for (var j = 0; j < tabs.length; j++) - updatePageActionIcon(tabs[j].id, tabs[j].url); - } - }); -} function collapseThread(id) { diff --git a/manifest.json b/manifest.json index 02a2283d..15557783 100644 --- a/manifest.json +++ b/manifest.json @@ -61,8 +61,7 @@ } ], "permissions": [ - "tabs" - , "contextMenus" + "contextMenus" , "http://www.lmnopc.com/greasemonkey/shacklol/*" , "http://*.shacknews.com/*" ] diff --git a/options.js b/options.js index 569b6f1f..8d0ebd58 100644 --- a/options.js +++ b/options.js @@ -310,8 +310,3 @@ function saveOptions() status.innerHTML = ""; }, 1000); } - -// set the version number, so the page action icon will stop glowing once they visit the options page -localStorage["version"] = CURRENT_VERSION; -chrome.extension.getBackgroundPage().updatePageActionIcons(); -//chrome.extension.sendRequest({name: "updatePageActionIcons"}); diff --git a/release_notes.html b/release_notes.html new file mode 100644 index 00000000..f19b5a12 --- /dev/null +++ b/release_notes.html @@ -0,0 +1,20 @@ + + + Chrome Shack Release Notes + + +

Chrome Shack Release Notes

+

Version 1.12

+ +

Version 1.11

+ + + diff --git a/shack-new.png b/shack-new.png deleted file mode 100644 index af2b7dba1e5286f226d685831d31446e5b596c5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 715 zcmV;+0yO=JP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RV0|^ioAINXJ;Q#;vT}ebiR4C6~ zlfO$_Q545Nrb2uX(-cuC5=04xfUQEO;3CvYsZgOpI@xBBx{4iju#5kKn_8FBO)+$_ z=purH)ON54nubS+q&6DD=^OY3cFyb^zSYP9`SE<$i2zJifS~Hk{#M zC6n(V4zjFT=f)_J7=TgG;-ZXEHk$=)ZTax~xxS`YBovB60E*=@>+5W8;(25;EieeQ zw^w(d4X9Ln0L{(x_EIQ3hZZov+8SG1cpmxueRu-IVgRL*0s8yvlU!X@ET&lOHSB}3 zS-GyVS-~6l4zg_-qnQ~E4$5`8-H(9*S=KxF0@~e`G0NwE!dnoiQqk$D3)tq(D`}wQ%y4FmX~sw<74LMIXWT`ps$Z&k#w3+i0NsP$p%DCcX+Etv50MxPIGof xFi1E|PY+#P|AJGuRViv9=XrNHw5