diff --git a/manifest.json b/manifest.json index 4d204b3..37dc59f 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Witzig! - Nicht Witzig!", - "version": "0.3", + "version": "0.4", "description": "Replaces the thumb up and down in YouTube with a Witzig! and a Nicht Witzig! stamp.", diff --git a/witzig.js b/witzig.js index 586ecc1..377c504 100644 --- a/witzig.js +++ b/witzig.js @@ -20,6 +20,10 @@ function log(msg) { console.log("W!NW!: " + msg); } +function getURL(path) { + return chrome.runtime.getURL(path) || browser.runtime.getURL(path); +} + /* Grafikfunktionen */ @@ -50,9 +54,9 @@ function inject() { log("Stempelfläche vergrößert."); var image_container_object = document.querySelectorAll(image_container_path); log("Packe Stempel aus..."); - inject_image(image_container_object[0], browser.extension.getURL("media/sticker-witzig.png")); + inject_image(image_container_object[0], getURL("media/sticker-witzig.png")); log("Witzig!"); - inject_image(image_container_object[1], browser.extension.getURL("media/sticker-nicht-witzig.png")); + inject_image(image_container_object[1], getURL("media/sticker-nicht-witzig.png")); log("Nicht Witzig!"); }