Veraltete getURL Funktion behoben und Chrome kompatibilität hinzugefügt

This commit is contained in:
clerie 2018-06-24 13:42:41 +02:00
parent 5b52ccc184
commit f9288df638
2 changed files with 7 additions and 3 deletions

View File

@ -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.",

View File

@ -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!");
}