initialise extension

This commit is contained in:
Dovi Cowan 2022-07-20 15:13:17 +01:00
parent 424809ea7f
commit bb512c3848
Signed by: dcowan
GPG key ID: CC4A4CB950D7E579
2 changed files with 22 additions and 2 deletions

View file

@ -5,7 +5,27 @@
// let content = browser.i18n.getMessage("notificationContent", message.url);
}) */
chrome.runtime.onInstalled.addListener(function(details) {
if(details.reason == "install"){
chrome.storage.sync.set({
'hiddenItemsList': '{}'
})
console.log('Successfully initialised new install');
} else if ( details.reason == "update" ) {
console.log('Extension updated');
}
})
chrome.action.onClicked.addListener(async tab => {
var hiddenItemsList;
chrome.storage.sync.get(['hiddenItemsList'], function(result) {
hiddenItemsList = JSON.parse(result.hiddenItemsList);
console.log(hiddenItemsList);
});
try {
await chrome.scripting.insertCSS({
target: {

View file

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "eBay Item Remove - DEVELOPMENT BUILD",
"version": "0.0.1",
"version": "0.0.2",
"description": "Remove items you don't want to see from eBay",
@ -20,7 +20,7 @@
"service_worker": "background-script.js"
},
"permissions": [ "notifications", "webNavigation", "scripting" ],
"permissions": [ "notifications", "webNavigation", "scripting", "storage" ],
"host_permissions": [ "*://*.ebay.co.uk/*" ]
}