blob: 8e3c20fdebfad73e3fdb8fe6111acfe9bfbf42ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<!DOCTYPE html>
<body>
<script>
'use strict';
function remoteize(relpath) {
let curdir = location.href.replace(/\/[^\/]*$/, '/')
return curdir.replace('://', '://www1.') + relpath
}
function create_media_promise() {
return new Promise((resolve, reject) => {
let image = document.createElement('img')
image.onload = () => resolve('ok')
image.onerror = () => reject('image error')
image.src = remoteize('blank.html') // sw will replace with an image
})
}
</script>
</body>
|