diff --git a/.gitignore b/.gitignore index fcc644e..726cb4c 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,9 @@ node_modules/ # Stores VSCode versions used for testing VSCode extensions .vscode-test +# intellij config files +/.idea + # yarn v3 (w/o zero-install) # See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored .pnp.* diff --git a/src/index.ts b/src/index.ts index bf3c25b..f5dfb99 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,7 +194,7 @@ function start() { } continueLink.addEventListener('click', async () => { - if (isValidSuspectHref(suspectHref) === false) { + if (!isValidSuspectHref(suspectHref)) { console.log(`Disallowed Protocol, cannot continue.`); return; } @@ -208,4 +208,18 @@ function start() { window.location.href = suspectHref; }); + + const backToSafetyLink = document.getElementById('back-to-safety'); + if (!backToSafetyLink) { + throw new Error('Unable to locate back to safety link'); + } + + backToSafetyLink.addEventListener('click', async () => { + phishingSafelistStream.write({ + jsonrpc: '2.0', + method: 'backToSafetyPhishingWarning', + params: [], + id: createRandomId(), + }); + }); } diff --git a/static/index.html b/static/index.html index 49f0905..4066720 100644 --- a/static/index.html +++ b/static/index.html @@ -1,5 +1,5 @@ - +