mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-06-05 21:49:31 +02:00
Call CDNs directly to search something on the website (#1137)
This commit is contained in:
@ -33,6 +33,13 @@ var interceptor = {};
|
||||
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
let validCandidate, targetDetails, targetDomain, isGoogleFont, isGoogleMaterialIcons, initiatorDomain, isListed;
|
||||
|
||||
if (requestDetails['type'] === WebRequestType.MAIN_FRAME &&
|
||||
helpers.checkAllowlisted(tab.url, requestAnalyzer.allowlistedDomains)) {
|
||||
return {
|
||||
'cancel': false
|
||||
};
|
||||
}
|
||||
|
||||
targetDetails = requestAnalyzer.getLocalTarget(requestDetails, tab.url);
|
||||
if (targetDetails['result'] === 'blocked') {
|
||||
return {
|
||||
@ -85,6 +92,9 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
return interceptor._handleMissingCandidate(requestDetails.url, tabIdentifier);
|
||||
}
|
||||
|
||||
console.log(`${LogString.PREFIX} ${LogString.REPLACED_RESOURCE} ${targetDetails.path}`);
|
||||
log.append(tab.url, requestDetails.url, targetDetails.path, false);
|
||||
|
||||
return {
|
||||
'redirectUrl': chrome.runtime.getURL(targetDetails.path + fileGuard.secret)
|
||||
};
|
||||
|
Reference in New Issue
Block a user