Skip to content

Commit 1e3089d

Browse files
committed
fix: add 'vue:black-blank' event support to AttachVueSettledEvents
1 parent 2b19a99 commit 1e3089d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

userscript/source/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ const ArticleHTMLElement = await WaitForElement('#app', Win.document)
6363
const EventName = 'vue:settled'
6464
const ChangeEventName = 'vue:change'
6565
const UrlChangeEventName = 'vue:url-changed'
66+
const UrlBlackBlankEventName = 'vue:black-blank'
6667
AttachVueSettledEvents(ArticleHTMLElement, {
6768
QuietMs: 75,
6869
EventName: EventName,
6970
ChangeEventName: ChangeEventName,
70-
UrlChange: UrlChangeEventName
71+
UrlChange: UrlChangeEventName,
72+
BlackBlank: UrlBlackBlankEventName
7173
})
7274

7375
const OCRInstance = CreateOcrWorkerClient(Win, new Worker(URL.createObjectURL(new Blob([__OCR_WORKER_CODE__], { type: 'application/javascript' }))))

userscript/source/vuejsawait.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export function AttachVueSettledEvents(TargetEl: HTMLElement, Options: { QuietMs?: number; EventName?: string; ChangeEventName?: string; UrlChange?: string } = {}) {
1+
export function AttachVueSettledEvents(TargetEl: HTMLElement, Options: { QuietMs?: number; EventName?: string; ChangeEventName?: string; UrlChange?: string; BlackBlank?: string } = {}) {
22
const QuietMs = Options.QuietMs ?? 120
33
const EventName = Options.EventName ?? 'vue:settled'
44
const ChangeEventName = Options.ChangeEventName ?? 'vue:dom-changed'
55
const UrlChangeEventName = Options.UrlChange ?? 'vue:url-changed'
6-
const UrlBlackBlankEventName = Options.UrlChange ?? 'vue:black-blank'
6+
const UrlBlackBlankEventName = Options.BlackBlank ?? 'vue:black-blank'
77

88
if (!(TargetEl instanceof HTMLElement)) {
99
throw new TypeError('TargetEl must be an HTMLElement')

0 commit comments

Comments
 (0)