Fixed creating the web channel in the new web browser.

Mon, 21 Nov 2016 12:46:35 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 21 Nov 2016 12:46:35 +0100
changeset 5342
2b6821805f46
parent 5341
d874aeb629dc
child 5343
e9112dac1314

Fixed creating the web channel in the new web browser.

WebBrowser/Tools/Scripts.py file | annotate | diff | comparison | revisions
--- a/WebBrowser/Tools/Scripts.py	Sun Nov 20 17:42:59 2016 +0100
+++ b/WebBrowser/Tools/Scripts.py	Mon Nov 21 12:46:35 2016 +0100
@@ -50,9 +50,16 @@
                 return;
             }}
 
-            new QWebChannel(qt.webChannelTransport, function(channel) {{
-               registerExternal(channel.objects.eric_object);
-            }});
+            function registerWebChannel() {{
+                try {{
+                   new QWebChannel(qt.webChannelTransport, function(channel) {{
+                        registerExternal(channel.objects.eric_object);
+                   }});
+                }} catch (e) {{
+                    setTimeout(registerWebChannel, 100);
+                }}
+            }}
+            registerWebChannel();
 
         }})()"""
     

eric ide

mercurial