Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

bugfixes to make beastify and color_changer work #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beastify_edge/content_scripts/beastify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions beastify_edge/popup/choose_beast.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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();
2 changes: 2 additions & 0 deletions color_changer/js/background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
let browser = chrome || browser;

// listen for sendMessage() from content script
browser.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
Expand Down
1 change: 1 addition & 0 deletions color_changer/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions color_changer/js/popup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
let browser = chrome || browser;

// get the buttons by id
let aliceblue = document.getElementById('aliceblue');
let cornsilk = document.getElementById('cornsilk');
Expand Down
1 change: 1 addition & 0 deletions color_changer/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down