This version is a big overhaul and change in logic plus cleansup code styling.

This commit is contained in:
2018-05-07 03:23:22 -05:00
parent 57ae036aea
commit eb64dfcab6
11 changed files with 96 additions and 103 deletions

19
src/scripts/background.js Normal file
View File

@@ -0,0 +1,19 @@
function handleUpdated(tabId, changeInfo, tabInfo) {
if (changeInfo.url) {
var http = "http://www.youtube.com/watch?v=";
var https = "https://www.youtube.com/watch?v=";
var url = changeInfo.url;
if (url.includes(http) || url.includes(https)) {
browser.tabs.insertCSS(tabId, {
file: "/styles/betterYoutube.css"
});
browser.tabs.executeScript(tabId, {
file: "/scripts/betterYoutube.js"
});
}
}
}
browser.tabs.onUpdated.addListener(handleUpdated);