Skip to content

Commit d24d398

Browse files
scan origin from remotely hosted Frame
1 parent 68dcf08 commit d24d398

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

pages/better-admin-with-mechs/phantom-assets.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<div id=result>working</div>
22
<script type=module>
3-
// import * as frame from 'http://code.fed.wiki/assets/v1/frame.js'
4-
// const context = await frame.context()
5-
const sitemap = await fetch('/system/sitemap.json').then(res => res.json())
3+
import * as frame from 'http://code.fed.wiki/assets/v1/frame.js'
4+
const context = await frame.context()
5+
const origin = context.origin
6+
const sitemap = await fetch(`${origin}/system/sitemap.json`).then(res => res.json())
67
window.result.innerHTML = `
78
<pre></pre>
89
<button>start</button>
@@ -23,7 +24,7 @@
2324
async function scan(todo) {
2425
return Promise.all(
2526
todo.map(async info => {
26-
await fetch(`/${info.slug}.json`)
27+
await fetch(`${origin}/${info.slug}.json`)
2728
.then(res => res.json())
2829
.then(page => check(info,page))
2930
})

0 commit comments

Comments
 (0)