Skip to content

Commit a044a9f

Browse files
committed
feat: enhance splash screen with Tauri plugin integration and improved error handling
1 parent 099df2b commit a044a9f

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

fixtures/e2e-apps/tauri/splash.html

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,29 @@ <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="text/javascript">
39+
40+
<!-- CRITICAL: Load plugin JS explicitly for Tauri v2 dynamic windows -->
41+
<script type="module">
42+
import '@wdio/tauri-plugin';
43+
44+
// Debug: Verify plugin loaded
45+
console.log('[Splash] wdioTauri available:', !!window.wdioTauri);
46+
console.log('[Splash] __TAURI__ available:', !!window.__TAURI__);
47+
</script>
48+
49+
<script type="module">
4050
document.addEventListener('DOMContentLoaded', () => {
41-
var btn = document.getElementById('switch-main-window');
51+
const btn = document.getElementById('switch-main-window');
4252
if (!btn) return;
4353

44-
btn.addEventListener('click', () => {
45-
if (window.__TAURI__ && window.__TAURI__.core && window.__TAURI__.core.invoke) {
46-
window.__TAURI__.core.invoke('switch_to_main').catch((e) => {});
54+
btn.addEventListener('click', async () => {
55+
if (window.__TAURI__?.core?.invoke) {
56+
try {
57+
await window.__TAURI__.core.invoke('switch_to_main');
58+
console.log('[Splash] switch_to_main invoked successfully');
59+
} catch (e) {
60+
console.error('[Splash] switch_to_main failed:', e);
61+
}
4762
}
4863
});
4964
});

0 commit comments

Comments
 (0)