Revision 194f23f4
Added by koszko over 1 year ago
| content/content.js | ||
|---|---|---|
| 136 | 136 |
const html_ns = "http://www.w3.org/1999/xhtml"; |
| 137 | 137 |
const script = document.createElementNS(html_ns, "script"); |
| 138 | 138 |
|
| 139 |
script.innerText = script_contents; |
|
| 139 |
const blobby_opts = {type: "text/javascript;charset=UTF-8"};
|
|
| 140 |
const blobby = new Blob([script_contents], blobby_opts); |
|
| 141 |
script.src = URL.createObjectURL(blobby); |
|
| 140 | 142 |
script.setAttribute("nonce", policy.nonce);
|
| 141 | 143 |
document.documentElement.append(script); |
| 142 | 144 |
script.remove(); |
Also available in: Unified diff
inject scripts to pages utilizing blob: URLs