Compare commits

..

No commits in common. "master" and "0.0.5" have entirely different histories.

3 changed files with 2 additions and 43 deletions

1
.github/FUNDING.yml vendored
View file

@ -1 +0,0 @@
liberapay: dovicowan

View file

@ -20,8 +20,6 @@ chrome.action.onClicked.addListener(async tab => {
addButton();
readdItem();
// try {
// await chrome.scripting.insertCSS({
// target: {
@ -81,7 +79,7 @@ async function removeItems() {
if(hiddenItemsList.includes(parseInt(itemID))) {
console.log("Item " + itemID + " is in removelist!");
console.log(element.closest('.s-item'));
element.closest('.s-item').innerHTML = "REMOVED BY EBAY ITEM REMOVER <a href='#' class='ebayitemremover-extension_readditem' ebayitemremover-extension_itemid='" + itemID + "'>Readd</a>";
element.closest('.s-item').innerHTML = 'REMOVED BY EBAY ITEM REMOVER';
} else {
let parent = element.closest('.s-item');
@ -143,42 +141,4 @@ async function addButton() {
} catch (error) {
console.log("Error adding removal button! " + error);
}
}
async function readdItem() {
let queryOptions = { active: true, lastFocusedWindow: true };
let [tab] = await chrome.tabs.query(queryOptions);
let hiddenItemsList = await getHiddenItemsList();
try {
await chrome.scripting.executeScript({
target: {
tabId: tab.id,
},
args: [ hiddenItemsList ],
func: (hiddenItemsList) => {
Array.from(document.getElementsByClassName('ebayitemremover-extension_readditem')).forEach(element => {
element.addEventListener('click', (event) => {
let itemID = parseInt(event.currentTarget.getAttribute('ebayitemremover-extension_itemid'));
const index = hiddenItemsList.indexOf(itemID);
try {
hiddenItemsList.splice(index, 1);
} catch (error) {
alert("failed removing " + itemID);
}
chrome.storage.sync.set( {'hiddenItemsList': JSON.stringify(hiddenItemsList)}, function() {
alert("Done\nYou need to reload the page for this to take effect");
});
event.preventDefault();
event.preventDefault();
})
});
}
})
} catch (error) {
console.log("Error adding readd! " + error);
}
}

View file

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "eBay Item Remove - DEVELOPMENT BUILD",
"version": "0.0.6",
"version": "0.0.5",
"description": "Remove items you don't want to see from eBay",