eric6/WebBrowser/WebBrowserPage.py

changeset 8221
0572a215bd2f
parent 8218
7c09585bd960
child 8243
cc717c2ae956
equal deleted inserted replaced
8220:006ee31b4835 8221:0572a215bd2f
136 if scheme == "mailto": 136 if scheme == "mailto":
137 QDesktopServices.openUrl(url) 137 QDesktopServices.openUrl(url)
138 return False 138 return False
139 139
140 # AdBlock 140 # AdBlock
141 if url.scheme() == "abp": 141 if (
142 if WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url): 142 url.scheme() == "abp" and
143 return False 143 WebBrowserWindow.adBlockManager().addSubscriptionFromUrl(url)
144 ):
145 return False
144 146
145 # GreaseMonkey 147 # GreaseMonkey
146 try: 148 try:
147 # PyQtWebEngine >= 5.14.0 149 # PyQtWebEngine >= 5.14.0
148 navigationType = type_ in [ 150 navigationType = type_ in [
563 "res.y = window.scrollY;" 565 "res.y = window.scrollY;"
564 "return res;" 566 "return res;"
565 "})()", 567 "})()",
566 WebBrowserPage.SafeJsWorld 568 WebBrowserPage.SafeJsWorld
567 ) 569 )
568 if pos is not None: 570 pos = (
569 pos = QPointF(pos["x"], pos["y"]) 571 QPointF(0.0, 0.0) if pos is None
570 else: 572 else QPointF(pos["x"], pos["y"])
571 pos = QPointF(0.0, 0.0) 573 )
572 574
573 return pos 575 return pos
574 576
575 ############################################################# 577 #############################################################
576 ## Methods below implement protocol handler related functions 578 ## Methods below implement protocol handler related functions
724 726
725 certificateDict = Globals.toDict( 727 certificateDict = Globals.toDict(
726 Preferences.Prefs.settings.value("Ssl/CaCertificatesDict")) 728 Preferences.Prefs.settings.value("Ssl/CaCertificatesDict"))
727 for server in certificateDict: 729 for server in certificateDict:
728 localCAList = QSslCertificate.fromData(certificateDict[server]) 730 localCAList = QSslCertificate.fromData(certificateDict[server])
729 for cert in certList: 731 if any(cert in localCAList for cert in certList):
730 if cert in localCAList: 732 return True
731 return True 733
732 734 return all(not cert.isBlacklisted() for cert in certList)
733 for cert in certList:
734 if cert.isBlacklisted():
735 return False
736
737 return True

eric ide

mercurial