From b05e1291c8154ee2d492514e572c9a78b8df671e Mon Sep 17 00:00:00 2001 From: Rael Date: Wed, 18 Nov 2015 16:29:31 -0200 Subject: Starting the webkit-JS bridge earlier (#292) --- scudcloud-1.0/lib/wrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scudcloud-1.0/lib/wrapper.py b/scudcloud-1.0/lib/wrapper.py index 6ac594a..65c6c6b 100644 --- a/scudcloud-1.0/lib/wrapper.py +++ b/scudcloud-1.0/lib/wrapper.py @@ -83,6 +83,8 @@ class Wrapper(QWebView): def _loadStarted(self): # Some custom CSS to clean/fix UX self.settings().setUserStyleSheetUrl(QUrl.fromLocalFile(Resources.get_path("resources.css"))) + # Starting the webkit-JS bridge + self.page().currentFrame().addToJavaScriptWindowObject("desktop", self) def _urlChanged(self, qUrl): url = qUrl.toString() @@ -92,7 +94,6 @@ class Wrapper(QWebView): self.load(QUrl("https://"+qUrl.host()+"/messages/general")) def _loadFinished(self, ok=True): - self.page().currentFrame().addToJavaScriptWindowObject("desktop", self) self.page().currentFrame().evaluateJavaScript(self.js) self.window.statusBar().hide() -- cgit v1.1