mirror of
https://github.com/gorhill/uBlock.git
synced 2024-07-19 11:18:42 +02:00
Fix quirks re. diff-updater
This commit is contained in:
parent
1f88359964
commit
7b2149e595
@ -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": {
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user