aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/blacklister.js
blob: 37751b595db1783ee15184facc8721f098703960 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const extension = require('extensionizer')

var port = extension.runtime.connect({name: 'blacklister'})
port.postMessage({ 'pageLoaded': window.location.hostname })
port.onMessage.addListener(redirectIfBlacklisted)

function redirectIfBlacklisted (response) {
  const { blacklist } = response
  const host = window.location.hostname
  if (blacklist && blacklist === host) {
    window.location.href = 'https://metamask.io/phishing.html'
  }
}