diff --git a/package.json b/package.json index 94ec430..4d6da98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@list-kr/namulink", - "version": "9.0.0", + "version": "10.0.0", "description": "", "type": "module", "scripts": { diff --git a/sources/banner.txt b/sources/banner.txt index 150b357..ad35450 100644 --- a/sources/banner.txt +++ b/sources/banner.txt @@ -8,7 +8,7 @@ // @downloadURL https://cdn.jsdelivr.net/npm/@list-kr/namulink@latest/dist/NamuLink.user.js // @license MIT // -// @version 9.0.0 +// @version 10.0.0 // @author PiQuark6046 and contributors // // @match https://namu.wiki/* diff --git a/sources/src/index.ts b/sources/src/index.ts index 7863a39..a615814 100644 --- a/sources/src/index.ts +++ b/sources/src/index.ts @@ -1,9 +1,21 @@ +import type { TPowerLink } from './powerlink.js' + type unsafeWindow = typeof window // eslint-disable-next-line @typescript-eslint/naming-convention declare const unsafeWindow: unsafeWindow const Win = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window +Win.Object.defineProperty = new Proxy(Win.Object.defineProperty, { + apply(Target: typeof Object.defineProperty, This: null, Args: Parameters) { + if (Args[0] && typeof (Args[0] as TPowerLink).unitPath === 'string' + && /^\/[0-9]+\/namuwiki\/(?!sidebar-box)/.test((Args[0] as TPowerLink).unitPath)) { + return + } + return Reflect.apply(Target, This, Args) + } +}) + setInterval(() => { Array.from(document.querySelectorAll('div[class*=" "] div[class]')).filter(Filtered => Filtered instanceof HTMLElement && (Filtered.innerText.includes('파워링크') || Filtered.innerText === '') && Number(getComputedStyle(Filtered).getPropertyValue('padding-top').replaceAll('px', '')) >= 8 && diff --git a/sources/src/powerlink.ts b/sources/src/powerlink.ts index f215b72..d348c6a 100644 --- a/sources/src/powerlink.ts +++ b/sources/src/powerlink.ts @@ -1,55 +1,10 @@ -/* eslint-disable @typescript-eslint/no-unsafe-function-type */ /* eslint-disable @typescript-eslint/naming-convention */ -type TPowerLinkMixin = { - methods: Record<'contribution_link' | 'contribution_link_discuss' | 'doc_action_link' | 'doc_fulltitle' | 'onDynamicContentClick' | 'openQuickACLGroup' | 'to_duration' | 'url_encode' | 'user_doc' | string, Function> -} - -export type TPowerLinkContent = { - emits: string[] - components: Record - props: Record - render: Function - __cssModules: { - '$style': { - 'wiki-image': string, - 'wiki-image-wrapper': string, - }, - __scopeId: string - }, - NaverLoginImage: string, - NaverPayImage: string, - NaverPayPlusImage: string, - NaverTalkTalkImage: string - }, - mixins: TPowerLinkMixin[], - props: Record, - render: Function, - __cssModules: { - '$style': Record - __scopeId: string - } - } - }> - props: Record, - render: Function, - __cssModules: { - '$style': Record - }, - __scopeId: string - __v_skip: boolean -} - -export type TPowerLinkObj = Record - -export type TUnitPath = { +export type TPowerLink = { + destroyed: boolean, id: string, - refreshTick: number, + pFlag: boolean, size: number[], - sizeMapping: Array + sizeMapping: Array> + slot: null, unitPath: string -} - -export type TPowerLinkMini = Record>>> \ No newline at end of file +} \ No newline at end of file