forked from tornadocash/classic-ui
return app.html
This commit is contained in:
parent
7f28723142
commit
ee1073ff07
39
app.html
39
app.html
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html {{ HTML_ATTRS }}>
|
||||
<head {{ HEAD_ATTRS }}>
|
||||
<script>
|
||||
if (window.location.search) {
|
||||
console.log('redirect')
|
||||
window.location = window.location.origin + window.location.pathname
|
||||
}
|
||||
|
||||
function addScript(src) {
|
||||
const s = document.createElement('script')
|
||||
s.setAttribute('src', src)
|
||||
document.body.appendChild(s)
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const ipfsPathRegExp = /^(\/(?:ipfs|ipns)\/[^/]+)/
|
||||
const ipfsPathPrefix = (window.location.pathname.match(ipfsPathRegExp) || [])[1] || ''
|
||||
if (ipfsPathPrefix) {
|
||||
const scripts = [...document.getElementsByTagName('script')]
|
||||
|
||||
for (let i = 0; i < scripts.length; i++) {
|
||||
if (scripts[i].src) {
|
||||
const source = new URL(scripts[i].src)
|
||||
console.log('Loading', source.pathname)
|
||||
const newSource = window.location.origin + ipfsPathPrefix + source.pathname
|
||||
addScript(newSource)
|
||||
}
|
||||
}
|
||||
console.log('Finished')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
{{ HEAD }}
|
||||
</head>
|
||||
<body {{ BODY_ATTRS }}>
|
||||
{{ APP }}
|
||||
</body>
|
||||
</html>
|
@ -45,7 +45,6 @@ export default {
|
||||
},
|
||||
head: {
|
||||
title: 'Tornado.cash',
|
||||
script: [{ src: 'headerScript.js', async: false, defer: true }],
|
||||
meta: [
|
||||
{ charset: 'utf-8' },
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user