We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ac3e42 commit f8d7bc7Copy full SHA for f8d7bc7
1 file changed
extension/Userscripts Extension/Resources/content.js
@@ -108,12 +108,9 @@ function injectCSS(name, code) {
108
// browser.runtime.sendMessage({name: "API_ADD_STYLE_SYNC", css: code});
109
110
// write the css code to head of the document
111
- let wrapper = "const tag = document.createElement(\"style\");\n";
112
- wrapper += `tag.textContent = \`${code}\`;`;
113
- wrapper += "\ndocument.head.appendChild(tag);";
114
- // execute the code directly into the context of the content script (not page context)
115
- // wrapper += "console.log(window.browser)"; // this validates the execution env
116
- return Function(wrapper)();
+ const tag = document.createElement("style");
+ tag.textContent = code;
+ document.head.appendChild(tag);
117
}
118
119
function cspFallback(e) {
0 commit comments