321 |
321 |
322 if res: |
322 if res: |
323 QDesktopServices.openUrl(url) |
323 QDesktopServices.openUrl(url) |
324 return True |
324 return True |
325 elif info.domain == QWebPage.QtNetwork and \ |
325 elif info.domain == QWebPage.QtNetwork and \ |
326 info.error == QNetworkReply.ContentAccessDenied and \ |
326 info.error == QNetworkReply.ContentAccessDenied and \ |
327 info.errorString.startswith("AdBlockRule:"): |
327 info.errorString.startswith("AdBlockRule:"): |
328 if info.frame != info.frame.page().mainFrame(): |
328 if info.frame != info.frame.page().mainFrame(): |
329 # content in <iframe> |
329 # content in <iframe> |
330 docElement = info.frame.page().mainFrame()\ |
330 docElement = info.frame.page().mainFrame()\ |
331 .documentElement() |
331 .documentElement() |
332 for element in docElement.findAll("iframe"): |
332 for element in docElement.findAll("iframe"): |