inital commit
This commit is contained in:
commit
2698965b68
7 changed files with 76 additions and 0 deletions
50
background-script.js
Normal file
50
background-script.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* chrome.browserAction.onClicked.addListener(function () {
|
||||
console.log("Test");
|
||||
|
||||
// let title = browser.i18n.getMessage("notificationTitle");
|
||||
// let content = browser.i18n.getMessage("notificationContent", message.url);
|
||||
}) */
|
||||
|
||||
chrome.action.onClicked.addListener(async tab => {
|
||||
try {
|
||||
await chrome.scripting.insertCSS({
|
||||
target: {
|
||||
tabId: tab.id,
|
||||
},
|
||||
css: `.s-item a.s-item__link { border-style: solid; }`
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('CSS insert failed! ' + error);
|
||||
}
|
||||
|
||||
try {
|
||||
await chrome.scripting.executeScript({
|
||||
target: {
|
||||
tabId: tab.id,
|
||||
},
|
||||
func: () => {
|
||||
document.querySelectorAll('.s-item a.s-item__link').forEach(element => {
|
||||
let href = element.getAttribute('href');
|
||||
href = href.split('/');
|
||||
let itemID = href[href.length-1].split('?')[0];
|
||||
console.log(itemID);
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Get HREFs failed! ' + error);
|
||||
}
|
||||
});
|
||||
|
||||
chrome.webNavigation.onCompleted.addListener(function() {
|
||||
chrome.notifications.create({
|
||||
"type": "basic",
|
||||
"iconUrl": "icons/ebay-48.png",
|
||||
"title": 'My Notification',
|
||||
"message": 'Hi, this is eBay!'
|
||||
});
|
||||
}, {
|
||||
url: [{
|
||||
urlMatches : 'https://www.ebay.co.uk/'
|
||||
}]
|
||||
});
|
BIN
icons/128.png
Normal file
BIN
icons/128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
icons/ebay-48.png
Normal file
BIN
icons/ebay-48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
icons/ebay-original.png
Normal file
BIN
icons/ebay-original.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
26
manifest.json
Normal file
26
manifest.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"manifest_version": 3,
|
||||
"name": "eBay Item Remove - DEVELOPMENT BUILD",
|
||||
"version": "0.0.1",
|
||||
|
||||
"description": "Remove items you don't want to see from eBay",
|
||||
|
||||
"icons": {
|
||||
"48": "icons/ebay-48.png"
|
||||
},
|
||||
|
||||
"action": {
|
||||
"default_icon": {
|
||||
"48": "icons/ebay-48.png"
|
||||
},
|
||||
"default_title": "eBay Item Remove"
|
||||
},
|
||||
|
||||
"background": {
|
||||
"service_worker": "background-script.js"
|
||||
},
|
||||
|
||||
"permissions": [ "notifications", "webNavigation", "scripting" ],
|
||||
|
||||
"host_permissions": [ "*://*.ebay.co.uk/*" ]
|
||||
}
|
BIN
screenshots/fullpage.png
Normal file
BIN
screenshots/fullpage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 373 KiB |
BIN
screenshots/notification.png
Normal file
BIN
screenshots/notification.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
Loading…
Reference in a new issue