1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

Fix quirks re. diff-updater

This commit is contained in:
Raymond Hill 2023-11-13 09:42:31 -05:00
parent 1f88359964
commit 7b2149e595
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 7 additions and 6 deletions

View File

@ -16,7 +16,7 @@
"description": "A warning in the dashboard when navigating away from unsaved changes"
},
"dashboardUnsavedWarningStay": {
"message": "Stay",
"message": "Stay here",
"description": "Label for button to prevent navigating away from unsaved changes"
},
"dashboardUnsavedWarningIgnore": {
@ -164,7 +164,7 @@
"description": "Tooltip for the no-cosmetic-filtering per-site switch"
},
"popupTipNoCosmeticFiltering2": {
"message": "Click to enable cosmetic filtering on this site",
"message": "Click to longer disable cosmetic filtering on this site",
"description": "Tooltip for the no-cosmetic-filtering per-site switch"
},
"popupTipNoRemoteFonts": {

View File

@ -1203,6 +1203,7 @@ const getAssetDiffDetails = assetKey => {
}
out.diffExpires = getUpdateAfterTime(assetKey, true);
out.lastModified = cacheEntry.lastModified;
out.writeTime = cacheEntry.writeTime;
const assetEntry = assetSourceRegistry[assetKey];
if ( assetEntry === undefined ) { return; }
if ( Array.isArray(assetEntry.cdnURLs) === false ) { return; }
@ -1300,9 +1301,7 @@ async function diffUpdater() {
} else if ( data.status === 'nopatch-yet' || data.status === 'nodiff' ) {
ubolog(`Diff updater: skip update of ${data.name} using ${data.patchPath}\n\treason: ${data.status}`);
const assetKey = assetKeyFromDiffName(data.name);
assetCacheSetDetails(assetKey, {
writeTime: data.lastModified || 0
});
assetCacheSetDetails(assetKey, { writeTime: data.writeTime });
vAPI.messaging.broadcast({
what: 'assetUpdated',
key: assetKey,

View File

@ -117,7 +117,9 @@ function applyPatch(text, diff) {
let iAdjust = 0;
let iDiff = 0, nDiff = diffLines.length;
while ( iDiff < nDiff ) {
const diffParsed = /^([ad])(\d+) (\d+)$/.exec(diffLines[iDiff++]);
const diffLine = diffLines[iDiff++];
if ( diffLine === '' ) { break; }
const diffParsed = /^([ad])(\d+) (\d+)$/.exec(diffLine);
if ( diffParsed === null ) { return; }
const op = diffParsed[1];
const iOp = parseInt(diffParsed[2], 10);