Use a better method of grabbing the default WebContext

This commit is contained in:
Fierelier 2023-03-03 10:16:30 +01:00
parent c353260ad2
commit d4b5416b3f
1 changed files with 1 additions and 7 deletions

View File

@ -38,10 +38,4 @@ def decideDestination(download,suggested_filename):
def download(webContext,download):
download.connect("decide-destination",decideDestination)
contextConnected = None
def onWebviewCreated(webView):
global contextConnected
if contextConnected == None:
contextConnected = webView.props.web_context
contextConnected.connect("download-started",download)
eventHandler["webview:created"] = onWebviewCreated
WebKit2.WebContext.get_default().connect("download-started",download)