mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-01-11 22:40:32 +00:00
Inject JS before content loaded
This commit is contained in:
parent
693d545923
commit
2b5f1f727b
1 changed files with 2 additions and 2 deletions
|
|
@ -124,7 +124,7 @@ impl PartialUi for WebView {
|
|||
Ok(())
|
||||
}).expect("Cannot add full screen element changed");
|
||||
|
||||
webview.add_navigation_completed(move |wv, _| {
|
||||
webview.add_content_loading(move |wv, _| {
|
||||
wv.execute_script(r##"
|
||||
try{console.log('Shell JS injected');if(window.self === window.top) {
|
||||
window.qt={webChannelTransport:{send:window.chrome.webview.postMessage}};
|
||||
|
|
@ -133,7 +133,7 @@ impl PartialUi for WebView {
|
|||
}}catch(e){}
|
||||
"##, |_| Ok(())).expect("Cannot add script to webview");
|
||||
Ok(())
|
||||
}).expect("Cannot add navigation completed");
|
||||
}).expect("Cannot add content loading");
|
||||
|
||||
WebView::resize_to_window_bounds(Some(&controller), Some(hwnd));
|
||||
controller.put_is_visible(true).ok();
|
||||
|
|
|
|||
Loading…
Reference in a new issue