mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 21:00:13 +01:00
15 lines
458 B
JavaScript
15 lines
458 B
JavaScript
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'
|
|
}
|
|
}
|
|
|