mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[utils] Fix opening external URL on Linux (GTK)
This commit is contained in:
parent
8e5f579db7
commit
c89f9d82c7
|
@ -1,5 +1,6 @@
|
|||
import logging
|
||||
import json
|
||||
import webbrowser
|
||||
|
||||
logger = logging.getLogger('WebViewHelper')
|
||||
webview_available = True
|
||||
|
@ -24,9 +25,7 @@ window.ue = {
|
|||
registersignincompletecallback: pywebview.api.trigger_logout
|
||||
},
|
||||
common: {
|
||||
launchexternalurl: function(url) {
|
||||
window.open(url, "blank");
|
||||
},
|
||||
launchexternalurl: pywebview.api.open_url_external,
|
||||
// not required, just needs to be non-null
|
||||
auth: {
|
||||
completeLogin: pywebview.api.nop
|
||||
|
@ -77,6 +76,9 @@ class MockLauncher:
|
|||
def nop(self, *args, **kwargs):
|
||||
return
|
||||
|
||||
def open_url_external(self, url):
|
||||
webbrowser.open(url)
|
||||
|
||||
def trigger_logout(self, *args, **kwargs):
|
||||
self.inject_js = False
|
||||
# first obtain SID, then log out
|
||||
|
|
Loading…
Reference in a new issue