Skip to content

Commit 5325590

Browse files
committed
Refactored styles.update() for readability
1 parent 5030771 commit 5325590

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

block-quora-poe/block-quora-poe.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// @description:zh-TW 阻止 AI + Quora 的推廣/贊助答案
1414
// @author Adam Lui
1515
// @namespace https://github.com/adamlui
16-
// @version 2026.7.28.4
16+
// @version 2026.7.29
1717
// @license MIT
1818
// @icon https://cdn.jsdelivr.net/gh/adamlui/userscripts@f3e6bf0/assets/images/icons/sites/quora/icon64.png
1919
// @match *://*.quora.com/*
@@ -846,9 +846,9 @@
846846

847847
update({ key, append }) { // requires dom.js
848848
if (!key) return console.error('Option \'key\' required by styles.update()')
849-
const style = this[key] ; style.node ||= dom.create.style()
849+
const style = this[key]
850+
;(style.node ||= dom.create.style()).textContent = style.css
850851
if (( append ?? style.append ) && !style.node.isConnected) document.head.append(style.node)
851-
style.node.textContent = style.css
852852
},
853853

854854
tweaks: {

0 commit comments

Comments
 (0)