eric6/WebBrowser/WebBrowserPage.py

changeset 8243
cc717c2ae956
parent 8221
0572a215bd2f
child 8260
2161475d9639
equal deleted inserted replaced
8242:aa713ac50c0d 8243:cc717c2ae956
90 self.proxyAuthenticationRequired.connect( 90 self.proxyAuthenticationRequired.connect(
91 WebBrowserWindow.networkManager().proxyAuthentication) 91 WebBrowserWindow.networkManager().proxyAuthentication)
92 self.fullScreenRequested.connect(self.__fullScreenRequested) 92 self.fullScreenRequested.connect(self.__fullScreenRequested)
93 self.urlChanged.connect(self.__urlChanged) 93 self.urlChanged.connect(self.__urlChanged)
94 self.contentsSizeChanged.connect(self.__contentsSizeChanged) 94 self.contentsSizeChanged.connect(self.__contentsSizeChanged)
95 95 self.registerProtocolHandlerRequested.connect(
96 try: 96 self.__registerProtocolHandlerRequested)
97 self.registerProtocolHandlerRequested.connect(
98 self.__registerProtocolHandlerRequested)
99 except AttributeError:
100 # defined for Qt >= 5.11
101 pass
102 97
103 self.__sslConfiguration = None 98 self.__sslConfiguration = None
104 99
105 # Workaround for changing webchannel world inside 100 # Workaround for changing webchannel world inside
106 # acceptNavigationRequest not working 101 # acceptNavigationRequest not working
576 571
577 ############################################################# 572 #############################################################
578 ## Methods below implement protocol handler related functions 573 ## Methods below implement protocol handler related functions
579 ############################################################# 574 #############################################################
580 575
581 try: 576 @pyqtSlot("QWebEngineRegisterProtocolHandlerRequest")
582 @pyqtSlot("QWebEngineRegisterProtocolHandlerRequest") 577 def __registerProtocolHandlerRequested(self, request):
583 def __registerProtocolHandlerRequested(self, request): 578 """
584 """ 579 Private slot to handle the registration of a custom protocol
585 Private slot to handle the registration of a custom protocol 580 handler.
586 handler. 581
587 582 @param request reference to the registration request
588 @param request reference to the registration request 583 @type QWebEngineRegisterProtocolHandlerRequest
589 @type QWebEngineRegisterProtocolHandlerRequest 584 """
590 """ 585 from PyQt5.QtWebEngineCore import (
591 from PyQt5.QtWebEngineCore import ( 586 QWebEngineRegisterProtocolHandlerRequest
592 QWebEngineRegisterProtocolHandlerRequest 587 )
593 ) 588
594 589 if self.__registerProtocolHandlerRequest:
595 if self.__registerProtocolHandlerRequest: 590 del self.__registerProtocolHandlerRequest
596 del self.__registerProtocolHandlerRequest 591 self.__registerProtocolHandlerRequest = None
597 self.__registerProtocolHandlerRequest = None 592 self.__registerProtocolHandlerRequest = (
598 self.__registerProtocolHandlerRequest = ( 593 QWebEngineRegisterProtocolHandlerRequest(request)
599 QWebEngineRegisterProtocolHandlerRequest(request) 594 )
600 )
601 except TypeError:
602 # this is supported with Qt 5.12 and later
603 pass
604 595
605 def registerProtocolHandlerRequestUrl(self): 596 def registerProtocolHandlerRequestUrl(self):
606 """ 597 """
607 Public method to get the registered protocol handler request URL. 598 Public method to get the registered protocol handler request URL.
608 599

eric ide

mercurial