epic update background.js

This commit is contained in:
Index 2024-02-14 16:16:57 -06:00
parent a334e4be1d
commit 673f289fd3

View file

@ -102,6 +102,39 @@ chrome.contextMenus.onClicked.addListener(function (info, tab){
} }
}); });
/*
GREEN LOGO WHEN EXTENSION APPLIES TO CURRENT TAB PAGE, RED WHEN IT DOESN'T
COMING SOON
chrome.tabs.onActivated.addListener(function (info){
chrome.tabs.get(info.tabId, function(tab){
const Any = CheckIfScriptApplies(tab.url)
console.log(Any)
});
});
function CheckIfScriptApplies(url) {
return Manifest.content_scripts.forEach(script => {
COMMENT
if (matchesUrl(script.matches, url)) {
return true
}
script.matches.forEach(match => {
if (url.startsWith(match.replaceAll('*', ''))) {
return true
}
})
})
}
function matchesUrl(patterns, url) {
return patterns.some(pattern => {
return new RegExp(pattern).test(url);
});
}
*/
function CopyAssetID(id) { function CopyAssetID(id) {
navigator.clipboard navigator.clipboard
.writeText(id) .writeText(id)