diff --git a/beastify_edge/content_scripts/beastify.js b/beastify_edge/content_scripts/beastify.js index 26985e5..aae7ba9 100644 --- a/beastify_edge/content_scripts/beastify.js +++ b/beastify_edge/content_scripts/beastify.js @@ -37,6 +37,7 @@ * Listen for messages from the background script. * Call "beastify()" or "reset()". */ + let browser = chrome || browser; browser.runtime.onMessage.addListener((message) => { if (message.command === "beastify") { insertBeast(message.beastURL); diff --git a/beastify_edge/popup/choose_beast.js b/beastify_edge/popup/choose_beast.js index 53e6591..93ebd78 100644 --- a/beastify_edge/popup/choose_beast.js +++ b/beastify_edge/popup/choose_beast.js @@ -12,6 +12,7 @@ const hidePage = `body > :not(.beastify-image) { */ function listenForClicks() { document.addEventListener("click", function(e) { + let browser = chrome || browser; /** * Given the name of a beast, get the URL to the corresponding image. */ @@ -74,5 +75,6 @@ function listenForClicks() { * When the popup loads, inject a content script into the active tab, * and add a click handler. */ +let browser = chrome || browser; browser.tabs.executeScript({file: "/content_scripts/beastify.js"}); listenForClicks(); \ No newline at end of file diff --git a/color_changer/js/background.js b/color_changer/js/background.js index 9546e6f..4e6e2b3 100644 --- a/color_changer/js/background.js +++ b/color_changer/js/background.js @@ -1,3 +1,5 @@ +let browser = chrome || browser; + // listen for sendMessage() from content script browser.runtime.onMessage.addListener( function (request, sender, sendResponse) { diff --git a/color_changer/js/content.js b/color_changer/js/content.js index 7888209..4e7493c 100644 --- a/color_changer/js/content.js +++ b/color_changer/js/content.js @@ -4,6 +4,7 @@ var url = document.location.href; // if not on a docs.microsoft.com domain if (url.indexOf("//docs.microsoft.com") <= -1) { // send inactive icons + let browser = chrome || browser; browser.runtime.sendMessage({ "iconPath20": "images/inactive20.png", "iconPath40": "images/inactive40.png" diff --git a/color_changer/js/popup.js b/color_changer/js/popup.js index 69e7f61..01590c2 100644 --- a/color_changer/js/popup.js +++ b/color_changer/js/popup.js @@ -1,3 +1,5 @@ +let browser = chrome || browser; + // get the buttons by id let aliceblue = document.getElementById('aliceblue'); let cornsilk = document.getElementById('cornsilk'); diff --git a/color_changer/manifest.json b/color_changer/manifest.json index 11dc78f..eaf9c1b 100644 --- a/color_changer/manifest.json +++ b/color_changer/manifest.json @@ -1,4 +1,5 @@ { + "manifest_version": 2, "name": "Color Changer", "author": "Microsoft Edge Extension Developer", "description": "Change the color of the body on docs.microsoft.com",