|
@ -86,8 +86,6 @@ var onBeforeRequestHandler = function(details) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// console.debug('onBeforeRequestHandler()> "%s": %o', details.url, details);
|
|
|
|
|
|
|
|
|
|
|
|
var requestType = requestTypeNormalizer[details.type] || 'other'; |
|
|
var requestType = requestTypeNormalizer[details.type] || 'other'; |
|
|
|
|
|
|
|
|
// https://github.com/gorhill/httpswitchboard/issues/303
|
|
|
// https://github.com/gorhill/httpswitchboard/issues/303
|
|
@ -99,9 +97,9 @@ var onBeforeRequestHandler = function(details) { |
|
|
|
|
|
|
|
|
var requestURL = details.url; |
|
|
var requestURL = details.url; |
|
|
|
|
|
|
|
|
// Ignore non-http schemes
|
|
|
|
|
|
if ( requestScheme.lastIndexOf('http', 0) !== 0 ) { |
|
|
|
|
|
µm.logger.writeOne('', 'info', 'request not processed: ' + details.url); |
|
|
|
|
|
|
|
|
// Ignore non-network schemes
|
|
|
|
|
|
if ( µmuri.isNetworkScheme(requestScheme) === false ) { |
|
|
|
|
|
µm.logger.writeOne('', 'info', 'request not processed: ' + requestURL); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -160,7 +158,10 @@ var onBeforeRequestHandler = function(details) { |
|
|
var onBeforeSendHeadersHandler = function(details) { |
|
|
var onBeforeSendHeadersHandler = function(details) { |
|
|
var µm = µMatrix; |
|
|
var µm = µMatrix; |
|
|
|
|
|
|
|
|
// console.debug('onBeforeSendHeadersHandler()> "%s": %o', details.url, details);
|
|
|
|
|
|
|
|
|
// Ignore non-network schemes
|
|
|
|
|
|
if ( µm.URI.isNetworkScheme(details.url) === false ) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Re-classify orphan HTTP requests as behind-the-scene requests. There is
|
|
|
// Re-classify orphan HTTP requests as behind-the-scene requests. There is
|
|
|
// not much else which can be done, because there are URLs
|
|
|
// not much else which can be done, because there are URLs
|
|
@ -468,7 +469,6 @@ vAPI.net.onBeforeRequest = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
vAPI.net.onBeforeSendHeaders = { |
|
|
vAPI.net.onBeforeSendHeaders = { |
|
|
urls: [ 'http://*/*', 'https://*/*' ], |
|
|
|
|
|
extra: [ 'blocking', 'requestHeaders' ], |
|
|
extra: [ 'blocking', 'requestHeaders' ], |
|
|
callback: onBeforeSendHeadersHandler |
|
|
callback: onBeforeSendHeadersHandler |
|
|
}; |
|
|
}; |
|
|