classic-ui/plugins/detectIPFS.js
FreezyEx b32527e057 Revert "minor fixes"
This reverts commit 7f8f7c2aa1.
2022-10-13 16:03:54 +02:00

19 lines
569 B
JavaScript

/* eslint-disable no-console */
export default ({ store, isHMR, app }, inject) => {
inject('isLoadedFromIPFS', main)
}
function main() {
const whiteListedDomains = ['localhost:3000', 'tornadocash.eth.link', 'tornadocash.eth.limo']
const NETLIFY_REGEXP = /deploy-preview-(\d+)--tornadocash\.netlify\.app/
if (NETLIFY_REGEXP.test(window.location.host)) {
return false
} else if (!whiteListedDomains.includes(window.location.host)) {
console.warn('The page has been loaded from ipfs.io. LocalStorage is disabled')
return true
}
return false
}