|
13 | 13 | // @description:zh-TW 阻止 AI + Quora 的推廣/贊助答案 |
14 | 14 | // @author Adam Lui |
15 | 15 | // @namespace https://github.com/adamlui |
16 | | -// @version 2026.1.28 |
| 16 | +// @version 2026.5.19 |
17 | 17 | // @license MIT |
18 | 18 | // @icon https://cdn.jsdelivr.net/gh/adamlui/userscripts@f3e6bf0/assets/images/icons/sites/quora/icon64.png |
19 | 19 | // @match *://*.quora.com/* |
|
721 | 721 | return alert |
722 | 722 | }, |
723 | 723 |
|
724 | | - init(modal) { // requires lib/dom.js |
| 724 | + init(modal) { // requires dom.js |
725 | 725 | if (!this.styles) this.stylize() // to init/append stylesheet |
726 | 726 | modal.classList.add(this.class) ; modal.parentNode.classList.add(`${this.class}-bg`) |
727 | 727 | dom.addRisingParticles(modal) |
|
754 | 754 |
|
755 | 755 | safeWinOpen(url) { open(url, '_blank', 'noopener') }, // to prevent backdoor vulnerabilities |
756 | 756 |
|
757 | | - stylize() { // requires lib/dom.js + env |
| 757 | + stylize() { // requires dom.js + env |
758 | 758 | const { browser: { isMobile }, ui: { scheme }} = env |
759 | 759 | if (!this.styles) document.head.append(this.styles = dom.create.elem('style')) |
760 | 760 | this.styles.textContent = ( |
|
799 | 799 |
|
800 | 800 | window.styles = { |
801 | 801 |
|
802 | | - update({ key, autoAppend }) { // requires lib/dom.js |
| 802 | + update({ key, append }) { // requires dom.js |
803 | 803 | if (!key) return console.error('Option \'key\' required by styles.update()') |
804 | 804 | const style = this[key] ; style.node ||= dom.create.style() |
805 | | - if (( autoAppend ?? style.autoAppend ) && !style.node.isConnected) document.head.append(style.node) |
| 805 | + if (( append ?? style.autoAppend ) && !style.node.isConnected) document.head.append(style.node) |
806 | 806 | style.node.textContent = style.css |
807 | 807 | }, |
808 | 808 |
|
|
0 commit comments