summaryrefslogtreecommitdiff
path: root/media-video/stremio/files/preload-script-injection.patch
blob: fa81e09ae1b0162fff4f1e3d0ded4dbde62200f1 (plain)
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
The web interface needs the preload script when its first document starts.
Register it before loading the startup URL to avoid a navigation race

diff --git a/src/app/imp.rs b/src/app/imp.rs
--- a/src/app/imp.rs
+++ b/src/app/imp.rs
@@ -78,8 +78,8 @@
         let dev_mode = self.dev_mode.get();
 
         let webview = WebView::default();
+        webview.inject_script(PRELOAD_SCRIPT);
         webview.load_uri(&startup_url);
-        webview.inject_script(PRELOAD_SCRIPT);
         webview.dev_mode(dev_mode);
 
         let window = Window::new(&app);
diff --git a/src/app/webview/mod.rs b/src/app/webview/mod.rs
--- a/src/app/webview/mod.rs
+++ b/src/app/webview/mod.rs
@@ -43,7 +43,7 @@
             script,
             UserContentInjectedFrames::TopFrame,
             UserScriptInjectionTime::Start,
-            &[],
+            &["http://*/*", "https://*/*"],
             &[],
         );