Skip to content

Commit

Permalink
Narrowing security requirements, minor idiomatic updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
nsimmonds committed May 8, 2014
1 parent f0b1488 commit 8380935
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions mailscripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function changeDefaults(string){

port.onMessage.addListener(function(storage){
if (storage.toggle == "on")
tog = true
{tog = true}
else
tog = false
{tog = false}
def = storage["default"]
changeDefaults(def)
})
Expand All @@ -55,10 +55,10 @@ port.postMessage({sendMe: "localStorage"})
// the script is fully loaded. This is clearly a bug. Luckily, the way the below
// function is written, it doesn't take place until after the page is fully loaded.
$("a").click(function() {
if (tog === true) {
var url = this.href;
url = url.replace("mailto:",mailUrl);
url = url.replace("?subject=",subject);
$(this).attr("href",url);
if (tog === true) {
var url = this.href;
url = url.replace("mailto:",mailUrl);
url = url.replace("?subject=",subject);
$(this).attr("href",url);
}
});
});
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"content_scripts": [
{
"matches": ["*://*/*"],
"matches": ["http://*/*","https://*/*"],
"js": [
"jquery-1.7.2.min.js",
"mailscripts.js"
Expand Down
1 change: 1 addition & 0 deletions toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function setIcon() {
}

function toggle() {
console.log("test");
if (localStorage["toggle"] === "on") {
chrome.browserAction.setIcon({path:"disicon.png"});
localStorage["toggle"] = "no";
Expand Down

0 comments on commit 8380935

Please sign in to comment.