mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-18 12:50:49 +01:00
Call CDNs directly to search something on the website (#1137)
This commit is contained in:
parent
a94d670991
commit
f2cc4bb2b8
@ -33,6 +33,13 @@ var interceptor = {};
|
|||||||
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||||
let validCandidate, targetDetails, targetDomain, isGoogleFont, isGoogleMaterialIcons, initiatorDomain, isListed;
|
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);
|
targetDetails = requestAnalyzer.getLocalTarget(requestDetails, tab.url);
|
||||||
if (targetDetails['result'] === 'blocked') {
|
if (targetDetails['result'] === 'blocked') {
|
||||||
return {
|
return {
|
||||||
@ -85,6 +92,9 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
|||||||
return interceptor._handleMissingCandidate(requestDetails.url, tabIdentifier);
|
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 {
|
return {
|
||||||
'redirectUrl': chrome.runtime.getURL(targetDetails.path + fileGuard.secret)
|
'redirectUrl': chrome.runtime.getURL(targetDetails.path + fileGuard.secret)
|
||||||
};
|
};
|
||||||
|
@ -202,9 +202,6 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`${LogString.PREFIX} ${LogString.REPLACED_RESOURCE} ${targetPath}`);
|
|
||||||
log.append(initiator, channelHost + channelPath, targetPath, false);
|
|
||||||
|
|
||||||
// Prepare and return a local target.
|
// Prepare and return a local target.
|
||||||
return {
|
return {
|
||||||
'source': channelHost,
|
'source': channelHost,
|
||||||
|
@ -50,6 +50,10 @@
|
|||||||
<li>jquery-minicolors v2.3.6 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1127">#1127</a>)</li>
|
<li>jquery-minicolors v2.3.6 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1127">#1127</a>)</li>
|
||||||
<li>in-view v0.6.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1127">#1127</a>)</li>
|
<li>in-view v0.6.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1127">#1127</a>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p>Improved</p>
|
||||||
|
<ul>
|
||||||
|
<li>Call CDNs directly to search something on the website (<a href="https://codeberg.org/nobody/LocalCDN/issues/1137">#1137</a>)</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="generator-section">
|
<div id="generator-section">
|
||||||
<div class="topic-label">
|
<div class="topic-label">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user