Skip to content

Commit

Permalink
Merge pull request gorhill#19 from gorhill/master
Browse files Browse the repository at this point in the history
Re-sync with uBo master
  • Loading branch information
pes10k authored Sep 15, 2020
2 parents 8110d5e + ad7b1ae commit 92ef8ef
Show file tree
Hide file tree
Showing 98 changed files with 2,280 additions and 1,902 deletions.
8 changes: 5 additions & 3 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@
let owner = root;
let chain = path;
for (;;) {
if ( owner instanceof Object === false ) { return false; }
if ( typeof owner !== 'object' || owner === null ) {
return false;
}
const pos = chain.indexOf('.');
if ( pos === -1 ) {
const found = owner.hasOwnProperty(chain);
Expand All @@ -299,8 +301,8 @@
) {
const next = chain.slice(pos + 1);
let found = false;
for ( const item of owner.values() ) {
found = findOwner(item, next, prune) || found;
for ( const key of Object.keys(owner) ) {
found = findOwner(owner[key], next, prune) || found;
}
return found;
}
Expand Down
6 changes: 3 additions & 3 deletions dist/firefox/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"uBlock0@raymondhill.net": {
"updates": [
{
"version": "1.29.3.8",
"version": "1.29.3.102",
"browser_specific_settings": { "gecko": { "strict_min_version": "55" } },
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.29.3b8",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.29.3b8/uBlock0_1.29.3b8.firefox.signed.xpi"
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.29.3rc2",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.29.3rc2/uBlock0_1.29.3rc2.firefox.signed.xpi"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion dist/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.29.3.8
1.29.3.102
5 changes: 5 additions & 0 deletions docs/tests/procedural-cosmetic-filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ <h3>Tests</h3>
<code>#pcf #a20 b:upward(.fail)</code>
</div>

<div id="a21" class="tile">
<div class="pass"><div class="fail"><a><b></b></a></div></div>
<code>#pcf #a21 b:upward(.fail):style(visibility: hidden !important)</code>
</div>

</div>

<script>
Expand Down
8 changes: 6 additions & 2 deletions platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
},
{
"matches": [
"http://*/*",
"https://*/*"
"https://easylist.to/*",
"https://*.fanboy.co.nz/*",
"https://filterlists.com/*",
"https://forums.lanik.us/*",
"https://github.com/*",
"https://*.github.io/*"
],
"js": [
"/js/scriptlets/subscriber.js"
Expand Down
23 changes: 18 additions & 5 deletions platform/chromium/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ window.addEventListener('webextFlavor', function() {

/******************************************************************************/

vAPI.randomToken = function() {
const n = Math.random();
return String.fromCharCode(n * 26 + 97) +
Math.floor(
(0.25 + n * 0.75) * Number.MAX_SAFE_INTEGER
).toString(36).slice(-8);
};

/******************************************************************************/

vAPI.app = {
name: manifest.name.replace(/ dev\w+ build/, ''),
version: (( ) => {
Expand Down Expand Up @@ -339,7 +349,10 @@ vAPI.Tabs = class {
return tabs.length !== 0 ? tabs[0] : null;
}

async insertCSS() {
async insertCSS(tabId, details) {
if ( vAPI.supportsUserStylesheets ) {
details.cssOrigin = 'user';
}
try {
await webext.tabs.insertCSS(...arguments);
}
Expand All @@ -357,7 +370,10 @@ vAPI.Tabs = class {
return Array.isArray(tabs) ? tabs : [];
}

async removeCSS() {
async removeCSS(tabId, details) {
if ( vAPI.supportsUserStylesheets ) {
details.cssOrigin = 'user';
}
try {
await webext.tabs.removeCSS(...arguments);
}
Expand Down Expand Up @@ -1003,9 +1019,6 @@ vAPI.messaging = {
frameId: sender.frameId,
matchAboutBlank: true
};
if ( vAPI.supportsUserStylesheets ) {
details.cssOrigin = 'user';
}
if ( msg.add ) {
details.runAt = 'document_start';
}
Expand Down
3 changes: 3 additions & 0 deletions platform/chromium/vapi-client-extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ vAPI.MessagingConnection = class {
listeners.add(listener);
vAPI.messaging.getPort(); // Ensure a port instance exists
}
static removeListener(listener) {
listeners.delete(listener);
}
static connectTo(from, to, handler) {
const port = vAPI.messaging.getPort();
if ( port === null ) { return; }
Expand Down
8 changes: 5 additions & 3 deletions platform/chromium/vapi-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ if (
/******************************************************************************/

vAPI.randomToken = function() {
const now = Date.now();
return String.fromCharCode(now % 26 + 97) +
Math.floor((1 + Math.random()) * now).toString(36);
const n = Math.random();
return String.fromCharCode(n * 26 + 97) +
Math.floor(
(0.25 + n * 0.75) * Number.MAX_SAFE_INTEGER
).toString(36).slice(-8);
};

vAPI.sessionId = vAPI.randomToken();
Expand Down
8 changes: 6 additions & 2 deletions platform/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
},
{
"matches": [
"http://*/*",
"https://*/*"
"https://easylist.to/*",
"https://*.fanboy.co.nz/*",
"https://filterlists.com/*",
"https://forums.lanik.us/*",
"https://github.com/*",
"https://*.github.io/*"
],
"js": [
"/js/scriptlets/subscriber.js"
Expand Down
18 changes: 11 additions & 7 deletions platform/opera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@
"run_at": "document_start"
},
{
"all_frames": false,
"js": [
"js/scriptlets/subscriber.js"
],
"matches": [
"http://*/*",
"https://*/*"
"https://easylist.to/*",
"https://*.fanboy.co.nz/*",
"https://filterlists.com/*",
"https://forums.lanik.us/*",
"https://github.com/*",
"https://*.github.io/*"
],
"js": [
"/js/scriptlets/subscriber.js"
],
"run_at": "document_idle"
"run_at": "document_idle",
"all_frames": false
}
],
"default_locale": "en",
Expand Down
8 changes: 6 additions & 2 deletions platform/thunderbird/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
},
{
"matches": [
"http://*/*",
"https://*/*"
"https://easylist.to/*",
"https://*.fanboy.co.nz/*",
"https://filterlists.com/*",
"https://forums.lanik.us/*",
"https://github.com/*",
"https://*.github.io/*"
],
"js": [
"/js/scriptlets/subscriber.js"
Expand Down
8 changes: 6 additions & 2 deletions platform/webext/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@
},
{
"matches": [
"http://*/*",
"https://*/*"
"https://easylist.to/*",
"https://*.fanboy.co.nz/*",
"https://filterlists.com/*",
"https://forums.lanik.us/*",
"https://github.com/*",
"https://*.github.io/*"
],
"js": [
"/js/scriptlets/subscriber.js"
Expand Down
12 changes: 8 additions & 4 deletions src/_locales/ar/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,12 @@
"description": "English: Network error: {{msg}}"
},
"subscriberConfirm": {
"message": "uBlock₀ : إضافة الرابط التالي للقوائم الفلترات الخاصة لك؟\n\nعنوان : \"{{title}}\"\nرابط : {{url}}",
"description": "English: The message seen by the user to confirm subscription to a ABP filter list"
"message": "µBlock : أضف الرابط التالي لقائمة الفلترة الخاصة بك؟\n\nعنوان : \"{{title}}\"\nرابط : {{url}}",
"description": "No longer used"
},
"subscribeButton": {
"message": "Subscribe",
"description": "For the button used to subscribe to a filter list"
},
"elapsedOneMinuteAgo": {
"message": "منذ دقيقة",
Expand Down Expand Up @@ -945,11 +949,11 @@
},
"docblockedPrompt1": {
"message": "uBlock₀ منع الصفحة التالية من التحميل:",
"description": "English: uBlock₀ has prevented the following page from loading:"
"description": "Used in the strict-blocking page"
},
"docblockedPrompt2": {
"message": "بسبب الفلتر التالي",
"description": "English: Because of the following filter"
"description": "Used in the strict-blocking page"
},
"docblockedNoParamsPrompt": {
"message": "دون معلمات",
Expand Down
12 changes: 8 additions & 4 deletions src/_locales/az/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@
"description": "English: dynamic rule syntax and full documentation."
},
"rulesSort": {
"message": "Çeşidlə:",
"message": "Sırala:",
"description": "English: label for sort option."
},
"rulesSortByType": {
Expand Down Expand Up @@ -905,7 +905,11 @@
},
"subscriberConfirm": {
"message": "uBlock₀: Aşağıdakı URL ünvanı fərdi filtr siyahılarınıza əlavə edilsin?\n\nAdı: \"{{title}}\"\nURL ünvanı: {{url}}",
"description": "English: The message seen by the user to confirm subscription to a ABP filter list"
"description": "No longer used"
},
"subscribeButton": {
"message": "Subscribe",
"description": "For the button used to subscribe to a filter list"
},
"elapsedOneMinuteAgo": {
"message": "bir dəqiqə əvvəl",
Expand Down Expand Up @@ -945,11 +949,11 @@
},
"docblockedPrompt1": {
"message": "uBlock Origin bu səhifənin yüklənməsini əngəllədi:",
"description": "English: uBlock₀ has prevented the following page from loading:"
"description": "Used in the strict-blocking page"
},
"docblockedPrompt2": {
"message": "Bu filtrə görə",
"description": "English: Because of the following filter"
"description": "Used in the strict-blocking page"
},
"docblockedNoParamsPrompt": {
"message": "parametrsiz",
Expand Down
10 changes: 7 additions & 3 deletions src/_locales/bg/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,11 @@
},
"subscriberConfirm": {
"message": "uBlock₀: Добавяне на следния адрес към потребителският списък с филтри?\n\nИме: \"{{title}}\"\nURL адрес: {{url}}",
"description": "English: The message seen by the user to confirm subscription to a ABP filter list"
"description": "No longer used"
},
"subscribeButton": {
"message": "Абониране",
"description": "For the button used to subscribe to a filter list"
},
"elapsedOneMinuteAgo": {
"message": "преди минута",
Expand Down Expand Up @@ -945,11 +949,11 @@
},
"docblockedPrompt1": {
"message": "uBlock Origin предотврати зареждането на страницата:",
"description": "English: uBlock₀ has prevented the following page from loading:"
"description": "Used in the strict-blocking page"
},
"docblockedPrompt2": {
"message": "Блокиращ филтър",
"description": "English: Because of the following filter"
"description": "Used in the strict-blocking page"
},
"docblockedNoParamsPrompt": {
"message": "без параметри",
Expand Down
10 changes: 7 additions & 3 deletions src/_locales/bn/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,11 @@
},
"subscriberConfirm": {
"message": "uBlock₀: আপনার নিজস্ব ফিল্টার তালিকায় নিম্নলিখিত URL যোগ করবেন?\n\nশিরোনাম: \"{{title}}\"\nURL: {{url}}",
"description": "English: The message seen by the user to confirm subscription to a ABP filter list"
"description": "No longer used"
},
"subscribeButton": {
"message": "Subscribe",
"description": "For the button used to subscribe to a filter list"
},
"elapsedOneMinuteAgo": {
"message": "এক মিনিট আগে",
Expand Down Expand Up @@ -945,11 +949,11 @@
},
"docblockedPrompt1": {
"message": "uব্লক অরিজিন নিচের পৃষ্ঠা লোড করাকে প্রতিহত করেছে:",
"description": "English: uBlock₀ has prevented the following page from loading:"
"description": "Used in the strict-blocking page"
},
"docblockedPrompt2": {
"message": "নিম্নলিখিত ফিল্টারের কারণে",
"description": "English: Because of the following filter"
"description": "Used in the strict-blocking page"
},
"docblockedNoParamsPrompt": {
"message": "প্যারামিটার বিহীন",
Expand Down
14 changes: 9 additions & 5 deletions src/_locales/bs/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,12 @@
"description": "English: Network error: {{msg}}"
},
"subscriberConfirm": {
"message": "uBlock₀: Add the following URL to your custom filter lists?\n\nTitle: \"{{title}}\"\nURL: {{url}}",
"description": "English: The message seen by the user to confirm subscription to a ABP filter list"
"message": "Add the following URL to your custom filter lists?\n\nTitle: \"{{title}}\"\nURL: {{url}}",
"description": "No longer used"
},
"subscribeButton": {
"message": "Subscribe",
"description": "For the button used to subscribe to a filter list"
},
"elapsedOneMinuteAgo": {
"message": "a minute ago",
Expand Down Expand Up @@ -945,11 +949,11 @@
},
"docblockedPrompt1": {
"message": "uBlock Origin has prevented the following page from loading:",
"description": "English: uBlock₀ has prevented the following page from loading:"
"description": "Used in the strict-blocking page"
},
"docblockedPrompt2": {
"message": "Because of the following filter",
"description": "English: Because of the following filter"
"message": "Because of the following filter:",
"description": "Used in the strict-blocking page"
},
"docblockedNoParamsPrompt": {
"message": "without parameters",
Expand Down
10 changes: 7 additions & 3 deletions src/_locales/ca/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,11 @@
},
"subscriberConfirm": {
"message": "uBlock₀: Voleu afegir aquesta URL a la llista de filtres personalitzats?\n\nTítol: \"{{title}}\"\nURL: {{url}}",
"description": "English: The message seen by the user to confirm subscription to a ABP filter list"
"description": "No longer used"
},
"subscribeButton": {
"message": "Subscriu-me",
"description": "For the button used to subscribe to a filter list"
},
"elapsedOneMinuteAgo": {
"message": "fa un minut",
Expand Down Expand Up @@ -945,11 +949,11 @@
},
"docblockedPrompt1": {
"message": "L'uBlock Origin ha impedit que es carregui la pàgina:",
"description": "English: uBlock₀ has prevented the following page from loading:"
"description": "Used in the strict-blocking page"
},
"docblockedPrompt2": {
"message": "Detectat per aquest filtre",
"description": "English: Because of the following filter"
"description": "Used in the strict-blocking page"
},
"docblockedNoParamsPrompt": {
"message": "sense paràmetres",
Expand Down
Loading

0 comments on commit 92ef8ef

Please sign in to comment.