From f9288df6385d492d249e544822779eeee9c0e905 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 24 Jun 2018 13:42:41 +0200 Subject: [PATCH] =?UTF-8?q?Veraltete=20getURL=20Funktion=20behoben=20und?= =?UTF-8?q?=20Chrome=20kompatibilit=C3=A4t=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- witzig.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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!"); }