summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-04-19 19:56:06 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2017-04-19 19:56:06 +0200
commitb316df60d796bcd0e190a5c4ebaf6966ba69dba4 (patch)
treef3a292899903e55b70c9742f9b16551f3e6d1332
parent96f1cd6d95de3226ce9ef24c8927993d5d2a7f22 (diff)
[feature] expose method to open url from js
- Resolves: #8838
-rw-r--r--src/leap/bitmask/gui/app.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py
index 0f98fa7..005ddab 100644
--- a/src/leap/bitmask/gui/app.py
+++ b/src/leap/bitmask/gui/app.py
@@ -25,6 +25,7 @@ import os
import platform
import signal
import sys
+import webbrowser
from functools import partial
from multiprocessing import Process
@@ -70,6 +71,7 @@ class BrowserWindow(QWebView):
python-js bridge:
bitmaskApp.shutdown() -> shut downs the backend and frontend.
+ bitmaskApp.openSystemBrowser(url) -> opens URL in system browser
bitmaskBrowser.openPixelated() -> opens Pixelated app in a new window.
"""
@@ -147,6 +149,10 @@ class AppProxy(QObject):
if browser:
browser.close()
+ @pyqtSlot(str)
+ def openSystemBrowser(self, url):
+ webbrowser.open(url)
+
pixbrowser = None