diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..56aa81e Binary files /dev/null and b/.DS_Store differ diff --git a/bluepill/.DS_Store b/bluepill/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/bluepill/.DS_Store differ diff --git a/bluepill/background.js b/bluepill/background.js new file mode 100644 index 0000000..4e71373 --- /dev/null +++ b/bluepill/background.js @@ -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(); diff --git a/bluepill/content.js b/bluepill/content.js new file mode 100644 index 0000000..ce1464c --- /dev/null +++ b/bluepill/content.js @@ -0,0 +1 @@ +console.log("Extension is running"); diff --git a/bluepill/icon0.png b/bluepill/icon0.png new file mode 100644 index 0000000..0cb787b Binary files /dev/null and b/bluepill/icon0.png differ diff --git a/bluepill/icon1.png b/bluepill/icon1.png new file mode 100644 index 0000000..1ad095c Binary files /dev/null and b/bluepill/icon1.png differ diff --git a/bluepill/manifest.json b/bluepill/manifest.json new file mode 100644 index 0000000..12ad178 --- /dev/null +++ b/bluepill/manifest.json @@ -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 +}