Skip to content

Commit

Permalink
noop
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Feb 16, 2024
1 parent 55e2bc4 commit d470de4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions content/extend_click_vc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ hooks = {
, listener: EventListenerOrEventListenerObject): void {
const a = this, args = arguments
const ret = args.length === 4 && type === GlobalConsts.MarkAcrossJSWorlds ? checkIsNotVerifier(args[3])
: newedCall ? newedCall(apply, [_listen, a, args]) : apply(_listen, a, args)
: callWithArgs(apply, [_listen, a, args])
if (type === "click" || type === "mousedown" || type === "dblclick"
? listener && a instanceof ElCls && a.localName !== "a" && a !== toRegister[toRegister.length - 1]
: type === kEventName2 && !isReRegistering
Expand Down Expand Up @@ -145,6 +145,7 @@ unsafeDispatchCounter = 0,
allNodesInDocument = null as Element[] | null, allNodesForDetached = null as Element[] | null,
pushToRegister = (nodeIndexList as unknown[] as Element[]).push.bind(toRegister),
queueMicroTask_ = queueMicrotask,
callWithArgs = <Args extends any[], R> (func: (...args: Args) => R, args: Args): R => func(...args),
isReRegistering: BOOL = 0, hasKnownDocOpened: 0 | 1 | 2 = 0
// To avoid a host script detect Vimum C by code like:
// ` a1 = setTimeout(()=>{}); $0.addEventListener('click', ()=>{}); a2=setTimeout(()=>{}); [a1, a2] `
Expand Down Expand Up @@ -275,7 +276,6 @@ const onDocOpen = (isWrite?: 0 | 2, oriHref?: string): void => {
}
}
const noop = (): 1 => { return 1 }
let newedCall: Function | undefined
const docEl = doc0.documentElement;
(function startHook(delayed?: 1): void {
if (!docEl || delayed && !(!docEl.lastChild && docEl.parentNode === doc0)) {
Expand All @@ -293,9 +293,7 @@ if (dataset && (
timer = toRegister.length > 0 ? setTimeout_(next, InnerConsts.DelayForNext) : 0
ETP[kAEL] = myAEL
FProto[kToS] = myToStr
try {
newedCall = new Function("f", "a", "return f(...a)")
} catch {}
try { callWithArgs = new Function("f", "a", "return f(...a)") as typeof callWithArgs } catch {}
for (let i of [0, 2] as const) { /*#__ENABLE_SCOPED__*/
let propName: "onmousedown" | "onclick" | "open" | "write" = i ? "onmousedown" : "onclick"
const setterName = ("set " + propName) as `set ${typeof propName}`
Expand Down

0 comments on commit d470de4

Please sign in to comment.