Skip to content

Commit 59f15ab

Browse files
committed
chore: use window.__TAURI__
1 parent ab25bf1 commit 59f15ab

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

fixtures/e2e-apps/tauri/splash.html

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,33 @@ <h1>Tauri E2E Test App</h1>
3636
<p>Splash Screen</p>
3737
<button id="switch-main-window" class="switch-main-window">Continue</button>
3838
</div>
39-
<script type="module">
40-
import '@wdio/tauri-plugin';
41-
document.getElementById('switch-main-window').addEventListener('click', async () => {
42-
await core.invoke('switch_to_main');
39+
<script type="text/javascript">
40+
// Wait for DOM to be ready
41+
document.addEventListener('DOMContentLoaded', () => {
42+
console.log('[Splash] DOM ready');
43+
console.log('[Splash] window.__TAURI__:', window.__TAURI__);
44+
45+
var btn = document.getElementById('switch-main-window');
46+
if (!btn) {
47+
console.error('[Splash] Button not found!');
48+
return;
49+
}
50+
51+
btn.addEventListener('click', () => {
52+
console.log('[Splash] Button clicked');
53+
if (window.__TAURI__ && window.__TAURI__.core && window.__TAURI__.core.invoke) {
54+
console.log('[Splash] Calling switch_to_main...');
55+
window.__TAURI__.core.invoke('switch_to_main')
56+
.then((result) => {
57+
console.log('[Splash] switch_to_main result:', result);
58+
})
59+
.catch((error) => {
60+
console.error('[Splash] switch_to_main error:', error);
61+
});
62+
} else {
63+
console.error('[Splash] window.__TAURI__.core.invoke not available');
64+
}
65+
});
4366
});
4467
</script>
4568
</body>

0 commit comments

Comments
 (0)