aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/redirect.js
blob: 879f5b530db2de1bda8ec10eee9766c5c8eae26a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
 * This is the entry point for redirects, and should be the only
 * web-accessible resource declared in the manifest.  This prevents
 * malicious websites from embedding wallet pages in them.
 * 
 * We still need this redirect page since a webRequest can only directly
 * redirect to pages inside the extension that are a web-accessible resource.
 */

const myUrl = new URL(window.location.href);
const redirectUrl = myUrl.searchParams.get("url");
if (!redirectUrl) {
  console.error("missing redirect URL");
} else {
  window.location.replace(redirectUrl);
}