MCPcopy Create free account
hub / github.com/PyQt5/PyQt / interceptRequest

Method interceptRequest

QWebEngineView/BlockRequest.py:27–32  ·  view source on GitHub ↗
(self, info)

Source from the content-addressed store, hash-verified

25class RequestInterceptor(QWebEngineUrlRequestInterceptor):
26
27 def interceptRequest(self, info):
28 url = info.requestUrl().toString()
29 if url.find('pos.baidu.com') > -1 and url.find('ltu=') > -1:
30 # 拦截百度联盟的广告
31 print('block:', url)
32 info.block(True)
33
34
35class Window(QWebEngineView):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected