Use a better method of grabbing the default WebContext
This commit is contained in:
parent
c353260ad2
commit
d4b5416b3f
|
@ -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)
|
Loading…
Reference in New Issue