mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-16 20:00:57 +01:00
Badge color for missing resources (#1031)
This commit is contained in:
parent
9cb5814f56
commit
7629412165
@ -33,6 +33,11 @@ var interceptor = {};
|
||||
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
let validCandidate, targetDetails, targetDomain, isGoogleFont, isGoogleMaterialIcons, initiatorDomain, isListed;
|
||||
|
||||
targetDetails = requestAnalyzer.getLocalTarget(requestDetails, tab.url);
|
||||
stateManager.requests[requestDetails.requestId] = {
|
||||
tabIdentifier, targetDetails
|
||||
};
|
||||
|
||||
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
|
||||
if (!validCandidate) {
|
||||
return {
|
||||
@ -74,8 +79,6 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
};
|
||||
}
|
||||
|
||||
targetDetails = requestAnalyzer.getLocalTarget(requestDetails, tab.url);
|
||||
|
||||
if (targetDetails['result'] === false) {
|
||||
if (!IgnoredHost[targetDomain]) {
|
||||
++stateManager.tabs[tabIdentifier].missing;
|
||||
@ -83,10 +86,6 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
return interceptor._handleMissingCandidate(requestDetails.url, tabIdentifier);
|
||||
}
|
||||
|
||||
stateManager.requests[requestDetails.requestId] = {
|
||||
tabIdentifier, targetDetails
|
||||
};
|
||||
|
||||
return {
|
||||
'redirectUrl': chrome.runtime.getURL(targetDetails.path + fileGuard.secret)
|
||||
};
|
||||
@ -106,6 +105,7 @@ interceptor._handleMissingCandidate = function (requestUrl, tabIdentifier) {
|
||||
missingCount = stateManager.tabs[tabIdentifier].missing || 0;
|
||||
if (missingCount > 0 && injectionCount === 0) {
|
||||
wrappers.setBadgeText(tabIdentifier, injectionCount);
|
||||
wrappers.setBadgeColoring(tabIdentifier, BadgeSettingMissingResource.TYPE);
|
||||
}
|
||||
} else {
|
||||
wrappers.setBadgeText(tabIdentifier, injectionCount);
|
||||
|
@ -65,6 +65,10 @@
|
||||
<li>twix.js v0.3.0 v1.3.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1029">#1029</a>)</li>
|
||||
<li>moment.js v2.5.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/1029">#1029</a>)</li>
|
||||
</ul>
|
||||
<p>Fixed</p>
|
||||
<ul>
|
||||
<li>Badge color for missing resources (<a href="https://codeberg.org/nobody/LocalCDN/issues/1031">#1031</a>)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="generator-section">
|
||||
<div class="topic-label">
|
||||
|
Loading…
x
Reference in New Issue
Block a user