diff --git a/content/apply.js b/content/apply.js index ac0e03d3..d18b0a22 100644 --- a/content/apply.js +++ b/content/apply.js @@ -330,9 +330,9 @@ function setContentsInPageContext() { try { - (document.head || ROOT).appendChild(document.createElement('script')).text = ` + (document.head || ROOT).appendChild(document.createElement('script')).text = `(${queue => { document.currentScript.remove(); - for (const {id, code} of ${JSON.stringify(pageContextQueue)}) { + for (const {id, code} of queue) { const el = document.getElementById(id) || document.querySelector('style.stylus[id="' + id + '"]'); if (!el) continue; @@ -340,7 +340,7 @@ el.textContent = code; el.sheet.disabled = disabled; } - `; + }})(${JSON.stringify(pageContextQueue)})`; } catch (e) {} let failedSome; for (const {el, code} of pageContextQueue) {