Skip to content

Commit

Permalink
remove requirement for 'tabs' permissions by displaying release notes…
Browse files Browse the repository at this point in the history
… after updating instead of showing the dumb red shack icon.
  • Loading branch information
arhughes committed Feb 22, 2011
1 parent c6728d5 commit 58fa582
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
27 changes: 8 additions & 19 deletions background.html
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
{
Expand Down
3 changes: 1 addition & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
}
],
"permissions": [
"tabs"
, "contextMenus"
"contextMenus"
, "http://www.lmnopc.com/greasemonkey/shacklol/*"
, "http://*.shacknews.com/*"
]
Expand Down
5 changes: 0 additions & 5 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"});
20 changes: 20 additions & 0 deletions release_notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<html>
<head>
<title>Chrome Shack Release Notes</title>
</head>
<body>
<h1>Chrome Shack Release Notes</h1>
<h2>Version 1.12</h2>
<ul>
<li>Fixed for New Shacknews</li>
<li>Remove 'tabs' permission (warned users that Chrome Shack had access to its browsing history).</li>
</ul>
<h2>Version 1.11</h2>
<ul>
<li>Support pichars.org in the image loader</li>
<li>Update employee and game developer list</li>
<li>Fix some highlighting problems in new comment marker script</li>
<li>add permission to http//*.shacknews.com/* to workaround dev channel regression</li>
</ul>
</body>
</html>
Binary file removed shack-new.png
Binary file not shown.

0 comments on commit 58fa582

Please sign in to comment.