-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-sdk.html
More file actions
56 lines (49 loc) · 2.02 KB
/
Copy pathtest-sdk.html
File metadata and controls
56 lines (49 loc) · 2.02 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SDK Test</title>
<style>
body { font-family: system-ui; padding: 40px; background: #111; color: #fff; }
button { padding: 12px 24px; font-size: 16px; margin: 10px; }
pre { background: #222; padding: 20px; border-radius: 8px; }
</style>
</head>
<body>
<h1>Phantom Browser SDK Test</h1>
<button onclick="testStaticImport()">Test Static Import</button>
<button onclick="testDynamicImport()">Test Dynamic Import</button>
<pre id="output">Click a button to test...</pre>
<script type="module">
const output = document.getElementById('output');
// Static Import Test
async function testStaticImport() {
output.textContent = 'Trying static import...';
try {
const mod = await import("@phantom/browser-sdk");
output.textContent = '✅ Static import SUCCESS!\n' + JSON.stringify(Object.keys(mod), null, 2);
} catch (err) {
output.textContent = '❌ Static import FAILED:\n' + err.message;
console.error(err);
}
}
// Dynamic Import Test
async function testDynamicImport() {
output.textContent = 'Trying dynamic import...';
try {
// @vite-ignore
const mod = await import("@phantom/browser-sdk");
output.textContent = '✅ Dynamic import SUCCESS!\n' + JSON.stringify(Object.keys(mod), null, 2);
} catch (err) {
output.textContent = '❌ Dynamic import FAILED:\n' + err.message;
console.error(err);
}
}
// Auto test on load
window.testStaticImport = testStaticImport;
window.testDynamicImport = testDynamicImport;
console.log('%c[SDK Test] Page loaded. Click buttons to test imports.', 'color: #888');
</script>
</body>
</html>