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

Function getRedirect

src/js/background.js:5–21  ·  view source on GitHub ↗
(url,referer,safe_in)

Source from the content-addressed store, hash-verified

3extension_version=brws.runtime.getManifest().version,
4definitions_version="",
5getRedirect=(url,referer,safe_in)=>{
6 if(!isGoodLink(url))
7 {
8 return
9 }
10 let redirectUrl=brws.runtime.getURL("html/before-navigate.html")+"?target="+encodeURIComponent(url)
11 if(referer)
12 {
13 redirectUrl+="&referer="+encodeURIComponent(referer)
14 }
15 if(safe_in!==undefined)
16 {
17 redirectUrl+="&safe_in="+safe_in
18 }
19 countIt()
20 return {redirectUrl}
21},
22encodedRedirect=(url,referer,safe_in)=>getRedirect(decodeURIComponent(url),referer,safe_in),
23isGoodLink=link=>{
24 if(typeof link !== "string"||(link.split("#")[0]==location.href.split("#")[0]&&!isGoodLink_allowSelf))

Callers 2

encodedRedirectFunction · 0.85
background.jsFile · 0.85

Calls 2

isGoodLinkFunction · 0.70
countItFunction · 0.70

Tested by

no test coverage detected