File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments