7 changed files with 48 additions and 0 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,25 @@ |
|||
'use strict'; |
|||
|
|||
var browser = browser || chrome |
|||
|
|||
browser.runtime.onInstalled.addListener(function() { |
|||
browser.storage.sync.set({number: 0}, function() { |
|||
console.log('The number is set to 0.'); |
|||
}); |
|||
}); |
|||
|
|||
function updateIcon() { |
|||
browser.storage.sync.get('number', function(data) { |
|||
var current = data.number; |
|||
browser.browserAction.setIcon({path: 'icon' + current + '.png'}); |
|||
current++; |
|||
if (current > 1) |
|||
current = 0; |
|||
browser.storage.sync.set({number: current}, function() { |
|||
console.log('The number is set to ' + current); |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
browser.browserAction.onClicked.addListener(updateIcon); |
|||
//updateIcon();
|
@ -0,0 +1 @@ |
|||
console.log("Extension is running"); |
After Width: | Height: | Size: 573 B |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,22 @@ |
|||
{ |
|||
"homepage_url": "https://1000scores.com", |
|||
"name": "bluepill", |
|||
"browser_specific_settings": { |
|||
"gecko": { |
|||
"id": "addon@example.com", |
|||
"strict_min_version": "42.0" |
|||
} |
|||
}, |
|||
"description": "changes your perspective on the web", |
|||
"version": "0.3", |
|||
"background": { |
|||
"scripts": ["background.js"], |
|||
"persistent": false |
|||
}, |
|||
"permissions": ["storage"], |
|||
"browser_action": { |
|||
"name": "Click to change your browsers perspective", |
|||
"default_icon": "icon0.png" |
|||
}, |
|||
"manifest_version": 2 |
|||
} |
Loading…
Reference in new issue