'Handle the given request.
Reimplementing this virtual function and setting the interceptor on a
profile makes it possible to intercept URL requests. This function is
executed on the IO thread, and therefore running long tasks here will
block networking.
info contains the information about the URL request and will track
internally whether its members have been altered.
Args:
info: QWebEngineUrlRequestInfo &info'

@utils.prevent_exceptions(None)
def interceptRequest(self, info):

    if self._host_blocker.is_blocked(info.requestUrl()):
        log.webview.info('Request    to    {}    blocked    by    host    blocker.'.format(info.requestUrl().host()))
        info.block(True)
    for (header, value) in shared.custom_headers():
        info.setHttpHeader(header, value)
    user_agent = config.get('network', 'user-agent')
    if (user_agent is not None):
        info.setHttpHeader('User-Agent', user_agent.encode('ascii'))
