WebBrowser/Network/NetworkManager.py

changeset 6120
4c60a21ce6dd
parent 6048
82ad8ec9548c
child 6166
bace7fb85a01
child 6554
5f1f2fcd9dee
diff -r 18fb5d765f3a -r 4c60a21ce6dd WebBrowser/Network/NetworkManager.py
--- a/WebBrowser/Network/NetworkManager.py	Tue Feb 06 19:21:00 2018 +0100
+++ b/WebBrowser/Network/NetworkManager.py	Wed Feb 07 18:57:46 2018 +0100
@@ -15,7 +15,6 @@
 from PyQt5.QtWidgets import qApp, QStyle, QDialog
 from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkProxy, \
     QNetworkProxyFactory, QNetworkRequest
-from PyQt5.QtWebEngineWidgets import QWebEnginePage
 
 from E5Gui import E5MessageBox
 
@@ -210,12 +209,16 @@
         else:
             return False
     
-    def authentication(self, url, auth):
+    def authentication(self, url, auth, page=None):
         """
         Public slot to handle an authentication request.
         
-        @param url URL requesting authentication (QUrl)
-        @param auth reference to the authenticator object (QAuthenticator)
+        @param url URL requesting authentication
+        @type QUrl
+        @param auth reference to the authenticator object
+        @type QAuthenticator
+        @param page reference to the web page
+        @type QWebEnginePage or None
         """
         urlRoot = "{0}://{1}"\
             .format(url.scheme(), url.authority())
@@ -249,8 +252,7 @@
                 WebBrowser.WebBrowserWindow.WebBrowserWindow.passwordManager()\
                     .setLogin(url, realm, username, password)
         else:
-            page = self.sender()
-            if isinstance(page, QWebEnginePage):
+            if page is not None:
                 self.__showAuthenticationErrorPage(page, url)
     
     def __showAuthenticationErrorPage(self, page, url):

eric ide

mercurial