Add partial YouTube compatibility shim

This commit is contained in:
hensm
2019-01-23 15:27:57 +00:00
parent 5c1c78016b
commit 2373880214
4 changed files with 55 additions and 18 deletions

10
ext/src/compat/youtube.js Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
// Insert script before first script is run
document.addEventListener("beforescriptexecute", function onBeforeScriptExecute () {
document.removeEventListener("beforescriptexecute", onBeforeScriptExecute);
const scriptElement = document.createElement("script");
scriptElement.src = browser.runtime.getURL("vendor/webcomponents-lite.min.js");
document.head.prepend(scriptElement);
});