-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOkuPlayer.html.xhtml
54 lines (50 loc) · 1.61 KB
/
OkuPlayer.html.xhtml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
iframe{
position:fixed;
left:0;
right:0;
top:0;
bottom:0;
border:none;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script>
var targetContent;
target = location.href.replace(".html.xhtml", ".html")
console.log(target);
var xhr = new XMLHttpRequest;
xhr.open("get", target);
xhr.overrideMimeType("text/html; charset=utf-8");
// xhr.responseType = "blob";
xhr.onload = function () {
document.open()
document.write(xhr.response);
document.close()
// var blob = xhr.response;
// var blobURL = URL.createObjectURL(blob);
// tempDoc = document.createElement("iframe");
// tempDoc.src = blobURL;
// document.body.appendChild(tempDoc);
// do stuff
};
xhr.send();
fetch(target)
.then(response => response.text())
.then(text => {
targetContent = text;
tempDoc = document.createElement("iframe");
tempDoc.srcdoc = targetContent;
// tempDoc.src = target;
// document.body.appendChild(tempDoc);
});
</script>
</body>
</html>