-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
113 lines (110 loc) · 3.97 KB
/
index.html
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>First Direct BZZ address</title>
<link rel="stylesheet" href="index.css" />
<script src="bee-js.min.js"></script>
<script src="swarm/swarm-html.js"></script>
<script src="swarm/index.js"></script>
<script src="index.js"></script>
</head>
<body>
<h1 id="first-bzz-page-title">Let's roll!</h1>
<div id="test-cases">
<h2>BZZ Protocol</h2>
<div>
<h4>Local Iframe</h4>
<iframe id="localhost-inner-ref" referrerpolicy="unsafe-url" src="jinn-page/index.html"></iframe>
</div>
<div>
<h4>BZZ Protocol Iframe</h4>
<iframe
id="bzz-iframe"
is="swarm-iframe"
referrerpolicy="unsafe-url"
sandbox="allow-scripts"
src="bzz://78e632d643b8ba7f67c495bd8a16092a0c380a23fa03444b923e193fabb79435"
></iframe>
</div>
<div>
<h4>Same External Iframe refer with localhost:1633</h4>
<iframe
id="localhost-iframe"
referrerpolicy="unsafe-url"
sandbox="allow-scripts"
src="http://127.0.0.1:1633/bzz/bd7da6a18921725b1c003d678d1030cf4b4e8bb05e1452848a71f090e0daeb9b"
></iframe>
</div>
<div>
<h4>External image refer by BZZ protocol</h4>
<img
id="bzz-image"
is="swarm-img"
width="300"
src="bzz://78e632d643b8ba7f67c495bd8a16092a0c380a23fa03444b923e193fabb79435/images/jinn.png"
/>
</div>
<div>
<h4>External image refer by bzz.link</h4>
<img
id="bzz-image-2"
is="swarm-img"
width="300"
src="https://bah5qcgzapdtdfvsdxc5h6z6esw6yufqjfigdqcrd7ibuis4shymt7k5xsq2q.bzz.link/images/jinn.png"
/>
</div>
<h2>Injected Swarm Script and Fake URL samples</h2>
<div>
<h4>Test connection</h4>
<button id="button-echo" onclick="echo()">Check</button>
<label id="echo-placeholder">[Echo Placeholder]</label>
</div>
<div>
<h4>Fetch Real Bee API URL</h4>
<button id="button-fetch-real-bee-api-url" onclick="fetchBeeApiUrl()">Fetch</button>
<label id="bee-api-url-placeholder">[Bee API URL Placeholder]</label>
</div>
<div>
<h4>Check if Globa Postage Batch is enabled</h4>
<button id="button-check-global-postage-batch-enabled" onclick="fetchGlobalPostageBatch()">Fetch</button>
<label id="global-postage-batch-placeholder">[Globa Postage Batch Enabled Placeholder]</label>
</div>
<div>
<h4>Check if Real Bee API is available</h4>
<button id="button-check-real-bee-api-available" onclick="checkBeeApiAvailable()">Fetch</button>
<label id="bee-api-available-placeholder">[Bee API Available Placeholder]</label>
</div>
<div>
<h4>Link to other page via BZZ protocol</h4>
<a id="bzz-ext-ref" is="swarm-a" href="bzz://78e632d643b8ba7f67c495bd8a16092a0c380a23fa03444b923e193fabb79435"
>Jinn page link 1</a
>
</div>
<div>
<h4>Fetch Jinn image via Fake URL with JavaScript</h4>
<button id="button-fetch-jinn-page" onclick="fetchJinnImage()">Fetch</button>
<div id="fake-url-fetch-jinn"></div>
</div>
<div>
<h4>Upload a file with BeeJS which is initialized by Fake URL</h4>
<button id="button-upload-fake-url-file" onclick="uploadFileWithBeeJs()">Upload</button>
<div id="fake-bzz-url-content-1"></div>
</div>
<h2>Local Storage handling</h2>
<div>
<h4>Local Storage handling in other dApp within iframe</h4>
<iframe
id="localstorage-iframe"
is="swarm-iframe"
src="bzz://248493b1cf4c9ed29f550d3c2d89d79f6358d35c7eea014bf7517f81d0f578a3"
></iframe>
</div>
</div>
<input
id="jinn-image-hash"
type="hidden"
value="78e632d643b8ba7f67c495bd8a16092a0c380a23fa03444b923e193fabb79435"
/>
</body>
</html>