File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -280,9 +280,35 @@ export function RunNamuLinkUserscript(BrowserWindow: typeof window, UserscriptNa
280280 return 3
281281 }
282282
283+ function MatchPL2TrackingString ( Value : string ) : boolean {
284+ const HotkeyArray : {
285+ Key : 'StartWith' | 'Includes' | 'EndsWith' ,
286+ String : string
287+ } [ ] = [ {
288+ Key : 'Includes' ,
289+ String : '//ader.naver.com/'
290+ } , {
291+ Key : 'Includes' ,
292+ String : '//ader.naver.com/'
293+ } , {
294+ Key : 'StartWith' ,
295+ String : '!/jump/'
296+ } ]
297+ return HotkeyArray . some ( Hotkey => {
298+ switch ( Hotkey . Key ) {
299+ case 'StartWith' :
300+ return Value . startsWith ( Hotkey . String )
301+ case 'Includes' :
302+ return Value . includes ( Hotkey . String )
303+ case 'EndsWith' :
304+ return Value . endsWith ( Hotkey . String )
305+ }
306+ } )
307+ }
308+
283309 function ProxySetHandlerNewValueCheck ( NewValue : Parameters < ProxyHandler < object > [ 'set' ] > [ 2 ] ) : boolean {
284310 let Stringified : string = String ( NewValue )
285- return Stringified . includes ( 'https://ader.naver.com/' )
311+ return MatchPL2TrackingString ( Stringified )
286312 }
287313
288314 function ProxySetHandlerTargetCheck (
@@ -308,7 +334,7 @@ export function RunNamuLinkUserscript(BrowserWindow: typeof window, UserscriptNa
308334 }
309335 } else if (
310336 typeof Value === 'string' &&
311- Value . includes ( 'ader.naver.com' )
337+ MatchPL2TrackingString ( Value )
312338 ) {
313339 return true
314340 }
You can’t perform that action at this time.
0 commit comments