blob: aa338efd3f14cb473a312eeb2aaa097931c5e272 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<html>
<body>
<img src="file_browser_refresh_image.sjs">
<iframe src="file_browser_refresh_iframe.sjs"></iframe>
<div id="result"></div>
<canvas id="canvas" width="100" height="100"> </canvas>
<script>
const image = document.querySelector("img");
const iframe = document.querySelector("iframe");
const result = document.getElementById("result");
iframe.addEventListener("load", function() {
result.setAttribute(
"iframeContent",
iframe.contentDocument.body.textContent
);
});
// Ensure images are loaded
image.addEventListener("load", function() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
result.setAttribute("imageDataURL", canvas.toDataURL());
});
// Ensure expired resources are still loaded
fetch('./file_browser_refresh_expired_resource.sjs').then((response) => {
let cacheControl = response.headers.get('Cache-Control');
result.setAttribute("expiredResourceCacheControl", cacheControl);
});
// Ensure non cacheable resources are still loaded
fetch('./file_browser_refresh_non_cacheable.sjs').then(() => {
result.setAttribute("nonCacheableResourceCompleted", true);
});
</script>
</body>
</html>
|