This commit is contained in:
Danil Kovtonyuk 2022-04-22 13:05:56 +10:00
commit 44f31f8b9f
No known key found for this signature in database
GPG key ID: E72A919BF08C3746
402 changed files with 47865 additions and 0 deletions

25
plugins/detectIPFS.js Normal file
View file

@ -0,0 +1,25 @@
/* eslint-disable no-console */
export default ({ store, isHMR, app }, inject) => {
inject('isLoadedFromIPFS', main)
}
function main() {
const domainWhiteList = [
'tornado.cash',
'localhost:3000',
'stage.tornado.cash',
'tornadocash.eth',
'tornadocash.eth.link',
'tornadocash.eth.limo',
'app.tornado.cash',
'donotshare.tornado.cash'
]
if (window.location.host.includes('tornadocash.netlify.app')) {
return false
} else if (!domainWhiteList.includes(window.location.host)) {
console.warn('The page has been loaded from ipfs.io. LocalStorage is disabled')
return true
}
return false
}