Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions userscript/source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+ *,[A-Za-z.-9]+ *, *[A-Za-z.-9]+ * *\) *; *}/
]]

function PowerLinkElementFromArg(Arg: unknown): HTMLElement | null {

Check warning on line 34 in userscript/source/index.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'PowerLinkElementFromArg' is defined but never used

Check warning on line 34 in userscript/source/index.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'PowerLinkElementFromArg' is defined but never used
if (typeof Arg !== 'object' || Arg === null) return null
if (typeof OriginalReflectApply(OriginalObjectGetOwnPropertyDescriptor, BrowserWindow.Object, [Arg, '_'])?.get === 'function') return null

Expand Down Expand Up @@ -309,33 +309,6 @@
return false
}

function ProxySetHandlerTargetCheckAndReplace(Target: object, NewValue: string): boolean {
const Record = Target as Record<string, unknown>

for (const PropertyName of Object.keys(Record)) {
const Value = Record[PropertyName]
const Descriptor = OriginalObjectGetOwnPropertyDescriptor(Target, PropertyName)

if (
typeof Value === 'object' &&
Value !== null &&
typeof Descriptor?.get !== 'function'
) {
if (ProxySetHandlerTargetCheckAndReplace(Value, NewValue)) {
return true
}
} else if (
typeof Value === 'string' &&
Value.includes('ader.naver.com')
) {
Record[PropertyName] = NewValue
return true
}
}

return false
}

function MatchesShape(Schema: unknown, Target: unknown): boolean {
if (Schema === null || Target === null) {
return Schema === Target
Expand Down Expand Up @@ -438,9 +411,6 @@
BrowserWindow.document.dispatchEvent(new CustomEvent('PL2PlaceHolderProxy'))
return
}
else if (ProxySetHandlerTargetCheckAndReplace(SetArgs[0], '')) {
console.debug(`[${UserscriptName}]: Proxy set called for PowerLink Skeleton (target check and replace):`, SetArgs)
}
return OriginalReflectApply(OriginalSet, this, SetArgs)
}
}
Expand Down
Loading