mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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'
|
|
}
|
|
}
|
|
|