MCPcopy Create free account
hub / github.com/LeFroid/Viper-Browser / GM_addStyle

Function GM_addStyle

src/app/assets/javascript/GreaseMonkeyAPI.js:13–30  ·  view source on GitHub ↗
(css)

Source from the content-addressed store, hash-verified

11 };
12
13 function GM_addStyle(css) {
14 var head = document.getElementsByTagName('head')[0];
15 if (!head) {
16 document.onreadystatechange = function () {
17 if (document.readyState == 'interactive') {
18 var newStyle = document.createElement('style');
19 newStyle.type = 'text/css';
20 newStyle.innerHTML = css; //.replace(/;/g, ' !important;');
21 document.getElementsByTagName('head')[0].appendChild(newStyle);
22 }
23 }
24 return;
25 }
26 var style = document.createElement('style');
27 style.type = 'text/css';
28 style.innerHTML = css; //.replace(/;/g, ' !important;');
29 head.appendChild(style);
30 }
31
32 function checkKey(key, funcName) {
33 if (typeof key !== "string") {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected