MCPcopy Index your code
hub / github.com/FastForwardTeam/FastForward / unsafelyNavigate

Function unsafelyNavigate

src/js/injection_script.js:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 location.assign(target)
60 },
61 unsafelyNavigate = target => {
62 if (navigated) {
63 return
64 }
65 //The background script will intercept the request and redirect to html/before-navigate.html or to the target depending on the user's settings.
66 let url = "https://fastforward.team/bypassed?target=" + encodeURIComponent(target) + "&referer=" + encodeURIComponent(referer)
67 switch (target)//All values here have been tested using "Take me to destinations after 0 seconds."
68 {
69 case (/(krnl\.place|hugegames\.io)/.exec(target) || {}).input:
70 url += "&safe_in=15"
71 break;
72 case (/(bowfile\.com)/.exec(target) || {}).input:
73 url += "&safe_in=20"
74 break;
75 }
76 unsafelyAssign(url)
77 },
78 parseTarget = target => target instanceof HTMLAnchorElement ? target.href : target,
79 safelyNavigate = (target, drophash) => {
80 target = parseTarget(target)

Callers 2

safelyNavigateFunction · 0.85

Calls 1

unsafelyAssignFunction · 0.85

Tested by

no test coverage detected