diff --git a/background.js b/background.js index 72c1ea0..f921157 100644 --- a/background.js +++ b/background.js @@ -1,15 +1,15 @@ chrome.runtime.onInstalled.addListener(function() { - chrome.storage.sync.set({isExtensionOn: true}, function() { - console.log('isExtensionOn: '+true); - }); + chrome.storage.sync.set({isExtensionOn: true}, function() { + console.log('isExtensionOn: '+true); + }); - chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { - chrome.declarativeContent.onPageChanged.addRules([{ - conditions: [new chrome.declarativeContent.PageStateMatcher({ - pageUrl: {hostEquals: 'vk.com'}, - }) - ], - actions: [new chrome.declarativeContent.ShowPageAction()] - }]); - }); - }); \ No newline at end of file + chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { + chrome.declarativeContent.onPageChanged.addRules([{ + conditions: [new chrome.declarativeContent.PageStateMatcher({ + pageUrl: {hostEquals: 'vk.com'}, + }) + ], + actions: [new chrome.declarativeContent.ShowPageAction()] + }]); + }); +}); \ No newline at end of file diff --git a/icon128.png b/icon128.png new file mode 100644 index 0000000..39feb8b Binary files /dev/null and b/icon128.png differ diff --git a/icon140.png b/icon140.png new file mode 100644 index 0000000..1b09f1a Binary files /dev/null and b/icon140.png differ diff --git a/icon48.png b/icon48.png new file mode 100644 index 0000000..3cbebba Binary files /dev/null and b/icon48.png differ diff --git a/manifest.json b/manifest.json index 5c7b0c9..db0305b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,9 @@ { "name": "Hide Cringe", + "icons": { + "128": "icon128.png", + "48": "icon48.png" + }, "version": "1.0", "description": "Hides cringe", "permissions": ["activeTab", "declarativeContent", "storage"], @@ -15,10 +19,12 @@ "manifest_version": 2, "content_scripts": [ { - "matches": [ - "https://*.vk.com/*" - ], + "matches": ["https://*.vk.com/*"], "js": ["hide_element.js"] + }, + { + "matches": ["https://*.vk.com/*"], + "js": ["controls.js"] } ] } diff --git a/popup.js b/popup.js index 8db6b7a..0462f5e 100644 --- a/popup.js +++ b/popup.js @@ -51,7 +51,7 @@ disableCheckbox.addEventListener('change', (event) => { }); }); -idToHideInput.addEventListener('input', (event) => { +idToHideInput.addEventListener('input', () => { chrome.storage.sync.set({idToHide: idToHideInput.value}, function() { console.log('idToHide: '+idToHideInput.value); });