revert: 回退到 v3.26.5 插件行为(v3.26.10),promptlib 回退 1.4.0 内容
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 53s

This commit is contained in:
qiqi committed 2026-11-21 22:50:21 +08:00
1 parent 5f8f4d229f
commit 9c0d3b1221
24 files changed
+64 -207

No files matched your search

+1 -4
View File
@@ -62,11 +62,8 @@
if (styleNodes[id] && styleNodes[id].parentNode) styleNodes[id].parentNode.removeChild(styleNodes[id])
const node = doc.createElement('style')
node.setAttribute('data-plugin', String(id))
// v3.26.8:CSP 带 nonce 时,没有 nonce 的内联 <style> 会被整段丢弃(实测 sheet=null)
try { const n0 = doc.querySelector('style[nonce], link[nonce]'); const nv = n0 ? String((/** @type {any} */ (n0)).nonce || n0.getAttribute('nonce') || '') : ''; if (nv) node.setAttribute('nonce', nv) } catch (e) { /* ignore */ }
node.textContent = String(css)
// v3.26.7:WKWebView 里动态插入 <head> 的 <style> 可能不生效(sheet=null),统一挂到 body
;(doc.body || doc.head).appendChild(node)
doc.head.appendChild(node)
styleNodes[id] = node
} catch (e) { /* 样式失败不影响脚本 */ }
}