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

Method interceptRequest

QWebEngineView/GetRequestInfo.py:75–84  ·  view source on GitHub ↗
(self, info)

Source from the content-addressed store, hash-verified

73class RequestInterceptor(QWebEngineUrlRequestInterceptor):
74
75 def interceptRequest(self, info):
76 url = info.requestUrl()
77 if url.scheme() == 'http':
78 # 重定向
79 url.setScheme('myurl')
80 info.redirect(url)
81 elif url.scheme() == 'https':
82 # 重定向
83 url.setScheme('myurls')
84 info.redirect(url)
85
86
87class Window(QWebEngineView):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected