mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbef7ec1cb | ||
|
|
484edb038a | ||
|
|
22e1f03c92 | ||
|
|
f0419a23c6 | ||
|
|
e8ab556411 |
11 changed files with 64 additions and 59 deletions
2
dist/version
vendored
2
dist/version
vendored
|
|
@ -1 +1 @@
|
|||
1.57.0
|
||||
1.57.2
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
"description": "Label for a checkbox in the options page"
|
||||
},
|
||||
"showBlockedCountLabel": {
|
||||
"message": "Show the number of blocked requests on the toolbar icon",
|
||||
"message": "কতগুলো অনুরোধ ব্লক করা হয়েছে তা টুলবার আইকনে দেখাও",
|
||||
"description": "Label for a checkbox in the options page"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
"description": "Label for a checkbox in the options page"
|
||||
},
|
||||
"showBlockedCountLabel": {
|
||||
"message": "Show the number of blocked requests on the toolbar icon",
|
||||
"message": "Ցուցադրել արգելափակված հայտերի քանակը գործիքների վահանակին",
|
||||
"description": "Label for a checkbox in the options page"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
"description": "This describes the 'complete' filtering mode"
|
||||
},
|
||||
"noFilteringModeDescription": {
|
||||
"message": "List of hostnames for which no filtering will take place.",
|
||||
"message": "Daftar nama host yang tidak akan difilter.",
|
||||
"description": "A short description for the editable field which lists trusted sites"
|
||||
},
|
||||
"behaviorSectionLabel": {
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
"description": "Label for a checkbox in the options page"
|
||||
},
|
||||
"showBlockedCountLabel": {
|
||||
"message": "Show the number of blocked requests on the toolbar icon",
|
||||
"message": "Tampilkan jumlah permintaan yang diblokir pada ikon toolbar",
|
||||
"description": "Label for a checkbox in the options page"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@
|
|||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupSocial": {
|
||||
"message": "Social widgets",
|
||||
"message": "أدوات مواقع التواصل الاجتماعية",
|
||||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupCookies": {
|
||||
|
|
@ -540,7 +540,7 @@
|
|||
"description": "Warning against copy-pasting filters from random sources"
|
||||
},
|
||||
"1pEnableMyFiltersLabel": {
|
||||
"message": "Enable my custom filters",
|
||||
"message": "تفعيل تصفياتي المخصصة",
|
||||
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
||||
},
|
||||
"1pTrustMyFiltersLabel": {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"description": "extension name."
|
||||
},
|
||||
"extShortDesc": {
|
||||
"message": "অবশেষে, একটি সাশ্রয়ী বিজ্ঞাপন রোধক। সিপিইউ এবং মেমরিতে নমনীয়।",
|
||||
"message": "একটি শক্তিশালী বিজ্ঞাপন প্রতিরোধক, অবশেষে তৈরী হল। যা সিপিইউ এবং মেমরির জন্য সহনীয়।",
|
||||
"description": "this will be in the Chrome web store: must be 132 characters or less"
|
||||
},
|
||||
"dashboardName": {
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
"description": "Label for button to prevent navigating away from unsaved changes"
|
||||
},
|
||||
"dashboardUnsavedWarningIgnore": {
|
||||
"message": "অবজ্ঞা করুন",
|
||||
"message": "বাদ দিন",
|
||||
"description": "Label for button to ignore unsaved changes"
|
||||
},
|
||||
"settingsPageName": {
|
||||
|
|
@ -136,19 +136,19 @@
|
|||
"description": "Tooltip for the no-popups per-site switch"
|
||||
},
|
||||
"popupTipNoPopups1": {
|
||||
"message": "এই সাইটে সব পপআপ অবরুদ্ধ করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে সকল পপআপ বন্ধ করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-popups per-site switch"
|
||||
},
|
||||
"popupTipNoPopups2": {
|
||||
"message": "এই সাইটে সব পপআপ আর অবরুদ্ধ না করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে আর কোনো পপআপ ব্লক না করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-popups per-site switch"
|
||||
},
|
||||
"popupTipNoLargeMedia": {
|
||||
"message": "এই সাইটের জন্য বড় মিডিয়া উপাদান অবরোধ চালু/বন্ধ করুন",
|
||||
"message": "এই সাইটের বড় মিডিয়া উপাদানগুলো অবরোধ ব্লক করার জন্য অদলবদল করুন",
|
||||
"description": "Tooltip for the no-large-media per-site switch"
|
||||
},
|
||||
"popupTipNoLargeMedia1": {
|
||||
"message": "এই সাইটে বড় মিডিয়া উপাদান অবরুদ্ধ করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে বড় মিডিয়া এলিমেন্ট ব্লক করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-large-media per-site switch"
|
||||
},
|
||||
"popupTipNoLargeMedia2": {
|
||||
|
|
@ -156,27 +156,27 @@
|
|||
"description": "Tooltip for the no-large-media per-site switch"
|
||||
},
|
||||
"popupTipNoCosmeticFiltering": {
|
||||
"message": "এই সাইটের জন্য কসমেটিক ছাঁকন চালু/বন্ধ করুন",
|
||||
"message": "এই সাইটের জন্য সৌন্দর্যবর্ধক ছাঁকন চালু/বন্ধ করুন",
|
||||
"description": "Tooltip for the no-cosmetic-filtering per-site switch"
|
||||
},
|
||||
"popupTipNoCosmeticFiltering1": {
|
||||
"message": "এই সাইটে কসমেটিক ফিল্টার নিষ্ক্রিয় করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে সৌন্দর্যবর্ধক ছাঁকন প্রক্রিয়া বন্ধ করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-cosmetic-filtering per-site switch"
|
||||
},
|
||||
"popupTipNoCosmeticFiltering2": {
|
||||
"message": "এই সাইটে কসমেটিক ফিল্টার সক্রিয় করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে সৌন্দর্যবর্ধক ছাঁকন প্রক্রিয়া চালু করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-cosmetic-filtering per-site switch"
|
||||
},
|
||||
"popupTipNoRemoteFonts": {
|
||||
"message": "এই সাইটের রিমোট ফন্টের অবরোধ চালু/বন্ধ করুন",
|
||||
"message": "এই সাইটের রিমোট ফন্ট বন্ধের প্রক্রিয়া অদলবদল করুন",
|
||||
"description": "Tooltip for the no-remote-fonts per-site switch"
|
||||
},
|
||||
"popupTipNoRemoteFonts1": {
|
||||
"message": "এই সাইটে রিমোট ফন্ট অবরুদ্ধ করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে রিমোট ফন্ট ব্লক করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-remote-fonts per-site switch"
|
||||
},
|
||||
"popupTipNoRemoteFonts2": {
|
||||
"message": "এই সাইটে রিমোট ফন্ট আর অবরুদ্ধ না করতে ক্লিক করুন",
|
||||
"message": "এই সাইটে রিমোট ফন্ট আর ব্লক না করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-remote-fonts per-site switch"
|
||||
},
|
||||
"popupTipNoScripting1": {
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
"description": "Tooltip for the no-scripting per-site switch"
|
||||
},
|
||||
"popupTipNoScripting2": {
|
||||
"message": "এই সাইটের জাভাস্ক্রিপ্ট চালু করতে ক্লিক করুণ",
|
||||
"message": "এই সাইটের জাভাস্ক্রিপ্ট চালু করতে ক্লিক করুন",
|
||||
"description": "Tooltip for the no-scripting per-site switch"
|
||||
},
|
||||
"popupNoPopups_v2": {
|
||||
|
|
@ -192,11 +192,11 @@
|
|||
"description": "Caption for the no-popups per-site switch"
|
||||
},
|
||||
"popupNoLargeMedia_v2": {
|
||||
"message": "বড় মিডিয়া এলিমেন্টগুলি",
|
||||
"message": "বড় মিডিয়ার এলিমেন্টগুলো",
|
||||
"description": "Caption for the no-large-media per-site switch"
|
||||
},
|
||||
"popupNoCosmeticFiltering_v2": {
|
||||
"message": "সৌন্দর্য্যবর্ধক ছাকন",
|
||||
"message": "সৌন্দর্য্যবর্ধক ছাকন প্রক্রিয়া",
|
||||
"description": "Caption for the no-cosmetic-filtering per-site switch"
|
||||
},
|
||||
"popupNoRemoteFonts_v2": {
|
||||
|
|
|
|||
|
|
@ -484,11 +484,11 @@
|
|||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupSocial": {
|
||||
"message": "Social widgets",
|
||||
"message": "Սոցիալական վիդջեթներ",
|
||||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupCookies": {
|
||||
"message": "Cookie notices",
|
||||
"message": "Cookie ծանուցում",
|
||||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupAnnoyances": {
|
||||
|
|
@ -540,11 +540,11 @@
|
|||
"description": "Warning against copy-pasting filters from random sources"
|
||||
},
|
||||
"1pEnableMyFiltersLabel": {
|
||||
"message": "Enable my custom filters",
|
||||
"message": "Թուլատրել իմ անհատական ֆիլտրերը",
|
||||
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
||||
},
|
||||
"1pTrustMyFiltersLabel": {
|
||||
"message": "Allow custom filters requiring trust",
|
||||
"message": "Թույլատրել վստահություն պահանջող հատուկ զտիչները",
|
||||
"description": "Label for the checkbox use to trust the content of 'My filters' list"
|
||||
},
|
||||
"1pImport": {
|
||||
|
|
@ -1264,7 +1264,7 @@
|
|||
"description": "Label for keyboard shortcut used to toggle cosmetic filtering"
|
||||
},
|
||||
"toggleJavascript": {
|
||||
"message": "Toggle JavaScript",
|
||||
"message": "Անջատել JavaScript֊ը",
|
||||
"description": "Label for keyboard shortcut used to toggle no-scripting switch"
|
||||
},
|
||||
"relaxBlockingMode": {
|
||||
|
|
|
|||
|
|
@ -484,11 +484,11 @@
|
|||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupSocial": {
|
||||
"message": "Social widgets",
|
||||
"message": "Widget sosial",
|
||||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupCookies": {
|
||||
"message": "Cookie notices",
|
||||
"message": "Pemberitahuan cookie",
|
||||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupAnnoyances": {
|
||||
|
|
@ -540,11 +540,11 @@
|
|||
"description": "Warning against copy-pasting filters from random sources"
|
||||
},
|
||||
"1pEnableMyFiltersLabel": {
|
||||
"message": "Enable my custom filters",
|
||||
"message": "Aktifkan filter kustom saya",
|
||||
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
||||
},
|
||||
"1pTrustMyFiltersLabel": {
|
||||
"message": "Allow custom filters requiring trust",
|
||||
"message": "Izinkan filter kustom yang memerlukan kepercayaan",
|
||||
"description": "Label for the checkbox use to trust the content of 'My filters' list"
|
||||
},
|
||||
"1pImport": {
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@
|
|||
"description": "English: or"
|
||||
},
|
||||
"popupBlockedOnThisPage_v2": {
|
||||
"message": "Blocked on this page",
|
||||
"message": "ಈ ಪುಟದಲ್ಲಿ ನಿರ್ಬಂಧಿಸಲಾಗಿದೆ",
|
||||
"description": "For the new mobile-friendly popup design"
|
||||
},
|
||||
"popupBlockedSinceInstall_v2": {
|
||||
"message": "Blocked since install",
|
||||
"message": "ಸ್ಥಾಪಿಸಿದಾಗಿನಿಂದ ನಿರ್ಬಂಧಿಸಲಾಗಿದೆ",
|
||||
"description": "For the new mobile-friendly popup design"
|
||||
},
|
||||
"popupDomainsConnected_v2": {
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@
|
|||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupCookies": {
|
||||
"message": "Avisos de cookie",
|
||||
"message": "Avisos de cookies",
|
||||
"description": "Filter lists section name"
|
||||
},
|
||||
"3pGroupAnnoyances": {
|
||||
|
|
@ -544,7 +544,7 @@
|
|||
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
||||
},
|
||||
"1pTrustMyFiltersLabel": {
|
||||
"message": "Permitir filtros personalizados que exijam confiança",
|
||||
"message": "Permitir filtros personalizados que requeiram confiança",
|
||||
"description": "Label for the checkbox use to trust the content of 'My filters' list"
|
||||
},
|
||||
"1pImport": {
|
||||
|
|
|
|||
|
|
@ -19,17 +19,14 @@
|
|||
Home: https://github.com/gorhill/uBlock
|
||||
*/
|
||||
|
||||
/* global indexedDB */
|
||||
|
||||
'use strict';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
import * as s14e from './s14e-serializer.js';
|
||||
|
||||
import lz4Codec from './lz4.js';
|
||||
import { ubolog } from './console.js';
|
||||
import webext from './webext.js';
|
||||
import µb from './background.js';
|
||||
import { ubolog } from './console.js';
|
||||
import * as s14e from './s14e-serializer.js';
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
|
@ -47,6 +44,10 @@ const keysFromGetArg = arg => {
|
|||
|
||||
let fastCache = 'indexedDB';
|
||||
|
||||
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
||||
const hasOwnProperty = (o, p) =>
|
||||
Object.prototype.hasOwnProperty.call(o, p);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Extension storage
|
||||
|
|
@ -65,7 +66,7 @@ const cacheStorage = (( ) => {
|
|||
if ( found.length === wanted.length ) { return; }
|
||||
const missing = [];
|
||||
for ( const key of wanted ) {
|
||||
if ( outbin.hasOwnProperty(key) ) { continue; }
|
||||
if ( hasOwnProperty(outbin, key) ) { continue; }
|
||||
missing.push(key);
|
||||
}
|
||||
return missing;
|
||||
|
|
@ -107,7 +108,7 @@ const cacheStorage = (( ) => {
|
|||
if ( argbin instanceof Object === false ) { return; }
|
||||
if ( Array.isArray(argbin) ) { return; }
|
||||
for ( const key of wanted ) {
|
||||
if ( argbin.hasOwnProperty(key) === false ) { continue; }
|
||||
if ( hasOwnProperty(argbin, key) === false ) { continue; }
|
||||
outbin[key] = argbin[key];
|
||||
}
|
||||
}).then(( ) => {
|
||||
|
|
@ -165,7 +166,7 @@ const cacheStorage = (( ) => {
|
|||
},
|
||||
|
||||
select(api) {
|
||||
if ( cacheAPIs.hasOwnProperty(api) === false ) { return fastCache; }
|
||||
if ( hasOwnProperty(cacheAPIs, api) === false ) { return fastCache; }
|
||||
fastCache = api;
|
||||
for ( const k of Object.keys(cacheAPIs) ) {
|
||||
if ( k === api ) { continue; }
|
||||
|
|
@ -485,16 +486,9 @@ const idbStorage = (( ) => {
|
|||
|
||||
// Cache API is subject to quota so we will use it only for what is key
|
||||
// performance-wise
|
||||
const shouldCache = bin => {
|
||||
const out = {};
|
||||
for ( const key of Object.keys(bin) ) {
|
||||
if ( key.startsWith('cache/' ) ) {
|
||||
if ( /^cache\/(compiled|selfie)\//.test(key) === false ) { continue; }
|
||||
}
|
||||
out[key] = bin[key];
|
||||
}
|
||||
if ( Object.keys(out).length === 0 ) { return; }
|
||||
return out;
|
||||
const shouldCache = key => {
|
||||
if ( key.startsWith('cache/') === false ) { return true; }
|
||||
return /^cache\/(compiled|selfie)\//.test(key);
|
||||
};
|
||||
|
||||
const fromBlob = data => {
|
||||
|
|
@ -591,7 +585,7 @@ const idbStorage = (( ) => {
|
|||
const transaction = db.transaction(STORAGE_NAME, 'readonly');
|
||||
transaction.oncomplete =
|
||||
transaction.onerror =
|
||||
transaction.onabort = ( ) => {
|
||||
transaction.onabort = ( ) => {
|
||||
resolve(Promise.all(entries));
|
||||
};
|
||||
const table = transaction.objectStore(STORAGE_NAME);
|
||||
|
|
@ -668,21 +662,32 @@ const idbStorage = (( ) => {
|
|||
if ( keys.length === 0 ) { return getAll(); }
|
||||
const entries = await getEntries(keys);
|
||||
const outbin = {};
|
||||
const toRemove = [];
|
||||
for ( const { key, value } of entries ) {
|
||||
if ( shouldCache(key) === false ) {
|
||||
toRemove.push(key);
|
||||
continue;
|
||||
}
|
||||
outbin[key] = value;
|
||||
}
|
||||
if ( argbin instanceof Object && Array.isArray(argbin) === false ) {
|
||||
for ( const key of keys ) {
|
||||
if ( outbin.hasOwnProperty(key) ) { continue; }
|
||||
if ( hasOwnProperty(outbin, key) ) { continue; }
|
||||
outbin[key] = argbin[key];
|
||||
}
|
||||
}
|
||||
if ( toRemove.length !== 0 ) {
|
||||
deleteEntries(toRemove);
|
||||
}
|
||||
return outbin;
|
||||
},
|
||||
|
||||
async set(rawbin) {
|
||||
const bin = shouldCache(rawbin);
|
||||
if ( bin === undefined ) { return; }
|
||||
const bin = {};
|
||||
for ( const key of Object.keys(rawbin) ) {
|
||||
if ( shouldCache(key) === false ) { continue; }
|
||||
bin[key] = rawbin[key];
|
||||
}
|
||||
return setEntries(bin);
|
||||
},
|
||||
|
||||
|
|
@ -695,7 +700,7 @@ const idbStorage = (( ) => {
|
|||
},
|
||||
|
||||
clear() {
|
||||
return getDb().then(db => {
|
||||
return getDb().then(db => {
|
||||
if ( db === null ) { return; }
|
||||
db.close();
|
||||
indexedDB.deleteDatabase(STORAGE_NAME);
|
||||
|
|
|
|||
Loading…
Reference in a new issue