blob: 2067075a2a0d2f20bbe68c164bb15e670a37fad3 [file] [log] [blame]
avm999634c1a6792020-08-31 21:30:42 +02001function injectStylesheet(stylesheetName) {
2 var link = document.createElement('link');
3 link.setAttribute('rel', 'stylesheet');
4 link.setAttribute('href', stylesheetName);
5 document.head.appendChild(link);
6}
7
8function injectStyles(css) {
9 injectStylesheet('data:text/css;charset=UTF-8,' + encodeURIComponent(css));
10}
11
12function injectScript(scriptName) {
13 var script = document.createElement('script');
14 script.src = scriptName;
15 document.head.appendChild(script);
16}