I am trying to make this extension delete this specific tab, but its not working.
Here is my backround.js
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(tab.id, {file: "bookmarklet.js"})
chrome.tabs.getCurrent(function(tab) {
chrome.tabs.remove(tab.id, function() { });
});
});
Here is my bookmarklet.js
if (window.location.href.indexOf(“unblocked”, “games”, “1v1”, “smash carts”, “slope unblocked”, “retrobowl”,) > -1) {
alert(“You are not supposed to be on the website. You will be reported to an adminstrator immediatly.”);
console.log(window.location.href)
chrome.tabs.getCurrent(function(tab) {
chrome.tabs.remove(tab.id, function() { });
});
How do I fix this? Thanks