Ok, So I was working on deleting tabs with a Chrome Extension, but it's not working. Here's my code for each file.
backround.js
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(tab.id, {file: "bookmarklet.js"})
});
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() { });
});
}else {
console.log("This Website is Safe")
}enter code here
My question is, how am I supposed to get the chrome. tab. remove function to work? Also my mainfest.json includes the tab permissions.