From a6d402aefe53adf380232b07c6de58f4ef838234 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 1 Dec 2016 11:42:56 -0500 Subject: [PATCH 01/23] new revision for dev build --- platform/chromium/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index 6d535eb37791d..b56dd00eccf1e 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.10.0", + "version": "1.10.1.0", "default_locale": "en", "description": "__MSG_extShortDesc__", From 98d2bbada774093fa05ca3c46b416b42c51531c0 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 1 Dec 2016 11:55:05 -0500 Subject: [PATCH 02/23] revise matches-css implementation as per #1930 and https://github.com/uBlockOrigin/uAssets/issues/212 --- src/js/contentscript.js | 65 +++++++++++++++++++----------------- src/js/cosmetic-filtering.js | 4 +-- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/js/contentscript.js b/src/js/contentscript.js index e972e61e6d1c8..6106d6a332753 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -137,7 +137,7 @@ var jobQueue = [ { t: 'css-csel', _0: [] } // to manually hide (not incremental) ]; -var reParserEx = /:(?:matches-css|has|style|xpath)\(.+?\)$/; +var reParserEx = /:(?:has|matches-css|matches-css-before|matches-css-after|style|xpath)\(.+?\)$/; var allExceptions = createSet(), allSelectors = createSet(), @@ -201,48 +201,45 @@ var runHasJob = function(job, fn) { } }; -var csspropDictFromString = function(s) { - var aa = s.split(/;\s+|;$/), - i = aa.length, - dict = Object.create(null), - prop, pos; - while ( i-- ) { - prop = aa[i].trim(); - if ( prop === '' ) { continue; } - pos = prop.indexOf(':'); - if ( pos === -1 ) { continue; } - dict[prop.slice(0, pos).trim()] = prop.slice(pos + 1).trim(); +// '/' = ascii 0x2F */ + +var parseMatchesCSSJob = function(raw) { + var prop = raw.trim(); + if ( prop === '' ) { return null; } + var pos = prop.indexOf(':'), + v = pos !== -1 ? prop.slice(pos + 1).trim() : '', + vlen = v.length; + if ( + vlen > 1 && + v.charCodeAt(0) === 0x2F && + v.charCodeAt(vlen-1) === 0x2F + ) { + try { v = new RegExp(v.slice(1, -1)); } catch(ex) { return null; } } - return dict; + return { k: prop.slice(0, pos).trim(), v: v }; }; var runMatchesCSSJob = function(job, fn) { - if ( job._2 === undefined ) { - if ( job._0.indexOf(':after', job._0.length - 6) !== -1 ) { - job._0 = job._0.slice(0, -6); - job._2 = ':after'; - } else { - job._2 = null; - } - } var nodes = document.querySelectorAll(job._0), i = nodes.length; if ( i === 0 ) { return; } if ( typeof job._1 === 'string' ) { - job._1 = csspropDictFromString(job._1); + job._1 = parseMatchesCSSJob(job._1); } - var node, match, style; + if ( job._1 === null ) { return; } + var k = job._1.k, + v = job._1.v, + node, style, match; while ( i-- ) { node = nodes[i]; style = window.getComputedStyle(node, job._2); - match = undefined; - for ( var prop in job._1 ) { - match = style[prop] === job._1[prop]; - if ( match === false ) { - break; - } + if ( style === null ) { continue; } /* FF */ + if ( v instanceof RegExp ) { + match = v.test(style[k]); + } else { + match = style[k] === v; } - if ( match === true ) { + if ( match ) { fn(node, job); } } @@ -332,7 +329,13 @@ var domFilterer = { if ( sel1.lastIndexOf(':has', 0) === 0 ) { this.jobQueue.push({ t: 'has-hide', raw: s, _0: sel0, _1: sel1.slice(5, -1) }); } else if ( sel1.lastIndexOf(':matches-css', 0) === 0 ) { - this.jobQueue.push({ t: 'matches-css-hide', raw: s, _0: sel0, _1: sel1.slice(13, -1) }); + if ( sel1.lastIndexOf(':matches-css-before', 0) === 0 ) { + this.jobQueue.push({ t: 'matches-css-hide', raw: s, _0: sel0, _1: sel1.slice(20, -1), _2: ':before' }); + } else if ( sel1.lastIndexOf(':matches-css-after', 0) === 0 ) { + this.jobQueue.push({ t: 'matches-css-hide', raw: s, _0: sel0, _1: sel1.slice(19, -1), _2: ':after' }); + } else { + this.jobQueue.push({ t: 'matches-css-hide', raw: s, _0: sel0, _1: sel1.slice(13, -1), _2: null }); + } } else if ( sel1.lastIndexOf(':style', 0) === 0 ) { this.job1._0.push(sel0 + ' { ' + sel1.slice(7, -1) + ' }'); this.job1._1 = undefined; diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index 8252d98bba431..ebfdc7392bd5b 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -218,7 +218,7 @@ var FilterParser = function() { this.hostnames = []; this.invalid = false; this.cosmetic = true; - this.reNeedHostname = /^(?:script:contains|script:inject|.+?:has|.+?:matches-css|:xpath)\(.+?\)$/; + this.reNeedHostname = /^(?:script:contains|script:inject|.+?:has|.+?:matches-css(?:-before|-after)?|:xpath)\(.+?\)$/; }; /******************************************************************************/ @@ -721,7 +721,7 @@ FilterContainer.prototype.isValidSelector = (function() { } var reHasSelector = /^(.+?):has\((.+?)\)$/, - reMatchesCSSSelector = /^(.+?):matches-css\((.+?)\)$/, + reMatchesCSSSelector = /^(.+?):matches-css(?:-before|-after)?\((.+?)\)$/, reXpathSelector = /^:xpath\((.+?)\)$/, reStyleSelector = /^(.+?):style\((.+?)\)$/, reStyleBad = /url\([^)]+\)/, From eacf93a1b1f782883a7fe706115b42ee2cefcc8a Mon Sep 17 00:00:00 2001 From: gorhill Date: Fri, 2 Dec 2016 12:15:54 -0500 Subject: [PATCH 03/23] avoid CPU-costly Date.(date|time)toLocaleString() --- src/js/logger-ui.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index c140c3da671d5..9bf8509f66bb7 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -98,18 +98,6 @@ var staticFilterTypes = { 'xhr': 'xmlhttprequest' }; -var timeOptions = { - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - hour12: false -}; - -var dateOptions = { - month: 'short', - day: '2-digit' -}; - /******************************************************************************/ var classNameFromTabId = function(tabId) { @@ -434,6 +422,12 @@ var createHiddenTextNode = function(text) { /******************************************************************************/ +var padTo2 = function(v) { + return v < 10 ? '0' + v : v; +}; + +/******************************************************************************/ + var createGap = function(tabId, url) { var tr = createRow('1'); tr.classList.add('tab'); @@ -547,8 +541,9 @@ var renderLogEntry = function(entry) { // Fields common to all rows. var time = new Date(entry.tstamp); - tr.cells[0].textContent = time.toLocaleTimeString('fullwide', timeOptions); - tr.cells[0].title = time.toLocaleDateString('fullwide', dateOptions); + tr.cells[0].textContent = padTo2(time.getHours()) + ':' + + padTo2(time.getMinutes()) + ':' + + padTo2(time.getSeconds()); if ( entry.tab ) { tr.classList.add('tab'); From 02a79ea9fcb8315cc525d8156349b9c79e512bac Mon Sep 17 00:00:00 2001 From: gorhill Date: Fri, 2 Dec 2016 12:15:54 -0500 Subject: [PATCH 04/23] avoid CPU-costly Date.toLocale(Date|Time)String() in logger page --- src/js/logger-ui.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index c140c3da671d5..9bf8509f66bb7 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -98,18 +98,6 @@ var staticFilterTypes = { 'xhr': 'xmlhttprequest' }; -var timeOptions = { - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - hour12: false -}; - -var dateOptions = { - month: 'short', - day: '2-digit' -}; - /******************************************************************************/ var classNameFromTabId = function(tabId) { @@ -434,6 +422,12 @@ var createHiddenTextNode = function(text) { /******************************************************************************/ +var padTo2 = function(v) { + return v < 10 ? '0' + v : v; +}; + +/******************************************************************************/ + var createGap = function(tabId, url) { var tr = createRow('1'); tr.classList.add('tab'); @@ -547,8 +541,9 @@ var renderLogEntry = function(entry) { // Fields common to all rows. var time = new Date(entry.tstamp); - tr.cells[0].textContent = time.toLocaleTimeString('fullwide', timeOptions); - tr.cells[0].title = time.toLocaleDateString('fullwide', dateOptions); + tr.cells[0].textContent = padTo2(time.getHours()) + ':' + + padTo2(time.getMinutes()) + ':' + + padTo2(time.getSeconds()); if ( entry.tab ) { tr.classList.add('tab'); From 235d1266e8283c8afc27e9b20ad1657d5a92d995 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 3 Dec 2016 09:21:31 -0500 Subject: [PATCH 05/23] fix #2210 --- src/js/logger-ui.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index 9bf8509f66bb7..ba05a6bd19b30 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -540,8 +540,9 @@ var renderLogEntry = function(entry) { } // Fields common to all rows. - var time = new Date(entry.tstamp); - tr.cells[0].textContent = padTo2(time.getHours()) + ':' + + var time = logDate; + time.setTime(entry.tstamp - logDateTimezoneOffset); + tr.cells[0].textContent = padTo2(time.getUTCHours()) + ':' + padTo2(time.getMinutes()) + ':' + padTo2(time.getSeconds()); @@ -561,6 +562,10 @@ var renderLogEntry = function(entry) { return tr; }; +// Reuse date objects. +var logDate = new Date(), + logDateTimezoneOffset = logDate.getTimezoneOffset() * 60000; + /******************************************************************************/ var renderLogEntries = function(response) { From 4837b15895f0da7d4b0de51bc79f058dda1b36d8 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 3 Dec 2016 14:03:28 -0500 Subject: [PATCH 06/23] fix #2206 --- src/js/dashboard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/dashboard.js b/src/js/dashboard.js index b3cdee4689b19..052c838ebfb89 100644 --- a/src/js/dashboard.js +++ b/src/js/dashboard.js @@ -40,7 +40,9 @@ var resizeFrame = function() { var loadDashboardPanel = function() { var pane = window.location.hash.slice(1); if ( pane === '' ) { - pane = 'settings.html'; + pane = vAPI.localStorage.getItem('dashboardLastVisitedPane') || 'settings.html'; + } else { + vAPI.localStorage.setItem('dashboardLastVisitedPane', pane); } var tabButton = uDom('[href="#' + pane + '"]'); if ( !tabButton || tabButton.hasClass('selected') ) { From d1ac1286b7b234c7e221f34638b37e304608d02c Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 09:43:11 -0500 Subject: [PATCH 07/23] addendum to fix for #2206: auto scroll to the end of user filters text box --- src/js/1p-filters.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/js/1p-filters.js b/src/js/1p-filters.js index 307a70e4f4bad..77ba955815796 100644 --- a/src/js/1p-filters.js +++ b/src/js/1p-filters.js @@ -36,22 +36,29 @@ var cachedUserFilters = ''; // This is to give a visual hint that the content of user blacklist has changed. -function userFiltersChanged() { - var changed = uDom.nodeFromId('userFilters').value.trim() !== cachedUserFilters; +function userFiltersChanged(changed) { + if ( typeof changed !== 'boolean' ) { + changed = uDom.nodeFromId('userFilters').value.trim() !== cachedUserFilters; + } uDom.nodeFromId('userFiltersApply').disabled = !changed; uDom.nodeFromId('userFiltersRevert').disabled = !changed; } /******************************************************************************/ -function renderUserFilters() { +function renderUserFilters(first) { var onRead = function(details) { - if ( details.error ) { - return; - } + if ( details.error ) { return; } + var textarea = uDom.nodeFromId('userFilters'); cachedUserFilters = details.content.trim(); - uDom.nodeFromId('userFilters').value = details.content; - userFiltersChanged(); + textarea.value = details.content; + if ( first ) { + textarea.value += '\n'; + var textlen = textarea.value.length; + textarea.setSelectionRange(textlen, textlen); + textarea.focus(); + } + userFiltersChanged(false); }; messaging.send('dashboard', { what: 'readUserFilters' }, onRead); } @@ -195,7 +202,7 @@ uDom('#userFilters').on('input', userFiltersChanged); uDom('#userFiltersApply').on('click', applyChanges); uDom('#userFiltersRevert').on('click', revertChanges); -renderUserFilters(); +renderUserFilters(true); /******************************************************************************/ From cfa70bde7b3afe37aacd4c4ff7b23cc38d89774f Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 09:49:43 -0500 Subject: [PATCH 08/23] minor code review --- platform/chromium/vapi-background.js | 76 +++++++++++++--------------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 573fc0b1d53fb..3aac3c4a1fcab 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -21,12 +21,12 @@ // For background page +'use strict'; + /******************************************************************************/ (function() { -'use strict'; - /******************************************************************************/ var vAPI = self.vAPI = self.vAPI || {}; @@ -873,20 +873,26 @@ vAPI.net.registerListeners = function() { is_v49_55 = /\bChrom[a-z]+\/(?:49|5[012345])\b/.test(navigator.userAgent); // Chromium-based browsers understand only these network request types. - var validTypes = { - 'main_frame': true, - 'sub_frame': true, - 'stylesheet': true, - 'script': true, - 'image': true, - 'object': true, - 'xmlhttprequest': true, - 'other': true - }; + var validTypes = [ + 'main_frame', + 'sub_frame', + 'stylesheet', + 'script', + 'image', + 'object', + 'xmlhttprequest', + 'other' + ]; + + var extToTypeMap = new Map([ + ['eot','font'],['otf','font'],['svg','font'],['ttf','font'],['woff','font'],['woff2','font'], + ['mp3','media'],['mp4','media'],['webm','media'], + ['gif','image'],['ico','image'],['jpeg','image'],['jpg','image'],['png','image'],['webp','image'] + ]); var denormalizeTypes = function(aa) { if ( aa.length === 0 ) { - return Object.keys(validTypes); + return validTypes; } var out = []; var i = aa.length, @@ -894,7 +900,7 @@ vAPI.net.registerListeners = function() { needOther = true; while ( i-- ) { type = aa[i]; - if ( validTypes.hasOwnProperty(type) ) { + if ( validTypes.indexOf(type) !== -1 ) { out.push(type); } if ( type === 'other' ) { @@ -933,49 +939,35 @@ vAPI.net.registerListeners = function() { return; } - var path = µburi.pathFromURI(details.url); - var pos = path.indexOf('.', path.length - 6); - - // https://github.com/chrisaljoudi/uBlock/issues/862 - // If no transposition possible, transpose to `object` as per - // Chromium bug 410382 (see below) - if ( pos !== -1 ) { - var needle = path.slice(pos) + '.'; - if ( '.eot.ttf.otf.svg.woff.woff2.'.indexOf(needle) !== -1 ) { - details.type = 'font'; - return; - } - - if ( '.mp3.mp4.webm.'.indexOf(needle) !== -1 ) { - details.type = 'media'; - return; - } - - // Still need this because often behind-the-scene requests are wrongly - // categorized as 'other' - if ( '.ico.png.gif.jpg.jpeg.webp.'.indexOf(needle) !== -1 ) { - details.type = 'image'; - return; - } + // Try to map known "extension" part of URL to request type. + var path = µburi.pathFromURI(details.url), + pos = path.indexOf('.', path.length - 6), + type; + if ( pos !== -1 && (type = extToTypeMap.get(path.slice(pos + 1))) ) { + details.type = type; + return; } // Try to extract type from response headers if present. if ( details.responseHeaders ) { - var contentType = headerValue(details.responseHeaders, 'content-type'); - if ( contentType.startsWith('font/') ) { + type = headerValue(details.responseHeaders, 'content-type'); + if ( type.startsWith('font/') ) { details.type = 'font'; return; } - if ( contentType.startsWith('image/') ) { + if ( type.startsWith('image/') ) { details.type = 'image'; return; } - if ( contentType.startsWith('audio/') || contentType.startsWith('video/') ) { + if ( type.startsWith('audio/') || type.startsWith('video/') ) { details.type = 'media'; return; } } + // https://github.com/chrisaljoudi/uBlock/issues/862 + // If no transposition possible, transpose to `object` as per + // Chromium bug 410382 // https://code.google.com/p/chromium/issues/detail?id=410382 if ( is_v38_48 ) { details.type = 'object'; From ce0b5ab5fb28c21c2bdc9c03055431e13bf9df7d Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 09:51:46 -0500 Subject: [PATCH 09/23] translation work from https://crowdin.com/project/ublock --- src/_locales/bg/messages.json | 2 +- src/_locales/et/messages.json | 2 +- src/_locales/hi/messages.json | 14 +++++++------- src/_locales/pl/messages.json | 2 +- src/_locales/vi/messages.json | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/_locales/bg/messages.json b/src/_locales/bg/messages.json index 25dedb371de70..782775f42dbc6 100644 --- a/src/_locales/bg/messages.json +++ b/src/_locales/bg/messages.json @@ -680,7 +680,7 @@ "description":"used as a prompt for the user to provide a custom device name" }, "advancedSettingsWarning":{ - "message":"Внимание! Промяната на тези разширени настройки е на ваш риск.", + "message":"Внимание! Променяте тези настройки на свой собствен риск.", "description":"A warning to users at the top of 'Advanced settings' page" }, "genericSubmit":{ diff --git a/src/_locales/et/messages.json b/src/_locales/et/messages.json index 9683ded94e910..edd521c2f94f1 100644 --- a/src/_locales/et/messages.json +++ b/src/_locales/et/messages.json @@ -424,7 +424,7 @@ "description":"English: dynamic rule syntax and full documentation." }, "whitelistPrompt":{ - "message":"Nimekiri domeenidest, millel uBlock₀ keelatakse. Üks domeen rea kohta, vigaseid domeeninimesid eiratakse.", + "message":"Nimekiri domeenidest, millel uBlock₀ keelatakse. Üks domeen rea kohta, vigased domeeninimed eiratakse vaikimisi ning kommenteeritakse välja.", "description":"English: An overview of the content of the dashboard's Whitelist pane." }, "whitelistImport":{ diff --git a/src/_locales/hi/messages.json b/src/_locales/hi/messages.json index 8cccf9ac3a8a2..2777ccbb282bc 100644 --- a/src/_locales/hi/messages.json +++ b/src/_locales/hi/messages.json @@ -256,7 +256,7 @@ "description":"English: Last restore:" }, "settingsLastBackupPrompt":{ - "message":"Last backup:", + "message":"पिछला बेकप", "description":"English: Last backup:" }, "3pListsOfBlockedHostsPrompt":{ @@ -496,11 +496,11 @@ "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartBlock":{ - "message":"Block", + "message":"रोको", "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartAllow":{ - "message":"Allow", + "message":"छोडो", "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartType":{ @@ -508,7 +508,7 @@ "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartAnyType":{ - "message":"any type", + "message":"हर टइप", "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartOrigin":{ @@ -516,7 +516,7 @@ "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartAnyOrigin":{ - "message":"from anywhere", + "message":"कहि से भी", "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartNotImportant":{ @@ -540,7 +540,7 @@ "description":"English: project' wiki on Github" }, "aboutSupport":{ - "message":"Support", + "message":"मदद", "description":"A link for where to get support" }, "aboutCode":{ @@ -560,7 +560,7 @@ "description":"English: my-ublock-backup_{{datetime}}.txt" }, "aboutRestoreDataButton":{ - "message":"Restore from file...", + "message":"फाइल से वापस करो", "description":"English: Restore from file..." }, "aboutResetDataButton":{ diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json index 3820731dfd4b0..942351821b327 100644 --- a/src/_locales/pl/messages.json +++ b/src/_locales/pl/messages.json @@ -424,7 +424,7 @@ "description":"English: dynamic rule syntax and full documentation." }, "whitelistPrompt":{ - "message":"Twoja lista nazw hostów, na których uBlock zostanie wyłączony. Jeden wpis na linię. Błędne nazwy hostów zostaną zignorowane.", + "message":"Wytyczne wyjątków nakazują, na których stronach uBlock Origin powinien zostać wyłączony. Jeden wpis na linię. Nieprawidłowe wytyczne zostaną bez powiadomienia zignorowane i wykomentowane.", "description":"English: An overview of the content of the dashboard's Whitelist pane." }, "whitelistImport":{ diff --git a/src/_locales/vi/messages.json b/src/_locales/vi/messages.json index d8a3ae58bf21f..f112d6f706eeb 100644 --- a/src/_locales/vi/messages.json +++ b/src/_locales/vi/messages.json @@ -40,7 +40,7 @@ "description":"appears as tab name in dashboard" }, "advancedSettingsPageName":{ - "message":"Advanced settings", + "message":"Cài đặt nâng cao", "description":"Title for the advanced settings page" }, "popupPowerSwitchInfo":{ @@ -212,7 +212,7 @@ "description":"" }, "settingsAdvancedUserSettings":{ - "message":"advanced settings", + "message":"cài đặt nâng cao", "description":"For the tooltip of a link which gives access to advanced settings" }, "settingsPrefetchingDisabledPrompt":{ @@ -680,7 +680,7 @@ "description":"used as a prompt for the user to provide a custom device name" }, "advancedSettingsWarning":{ - "message":"Warning! Change these advanced settings at your own risk.", + "message":"Cảnh báo! Bạn phải chịu trách nhiệm cho những nguy cơ khi thay đổi các cài đặt nâng cao này.", "description":"A warning to users at the top of 'Advanced settings' page" }, "genericSubmit":{ @@ -688,7 +688,7 @@ "description":"for generic 'Submit' buttons" }, "genericApplyChanges":{ - "message":"Apply changes", + "message":"Áp dụng các thay đổi", "description":"for generic 'Apply changes' buttons" }, "genericRevert":{ From a727a99e3538af68dbc573e4e76670054248daa9 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 09:52:42 -0500 Subject: [PATCH 10/23] new revision for dev build --- platform/chromium/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index b56dd00eccf1e..528b32d2df112 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.10.1.0", + "version": "1.10.1.1", "default_locale": "en", "description": "__MSG_extShortDesc__", From 51c73cfd494ebf017eb505df20b191a0137247a3 Mon Sep 17 00:00:00 2001 From: euf Date: Wed, 7 Dec 2016 18:01:46 +0300 Subject: [PATCH 11/23] Added a link to Safari version at Readme.md (#2222) Safari version was announced at #1596 and now available --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f216c8d3809e4..0aed9e4bb4a0e 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,11 @@ The Firefox version of uBlock Origin has [an extra feature](https://github.com/g Also of interest: [Deploying uBlock Origin for Firefox with CCK2 and Group Policy](http://decentsecurity.com/ublock-for-firefox-deployment/). -##### Debian/Ubuntu +#### Safari (macOS) + +Early development version: . + +#### Debian / Ubuntu Thanks to Debian contributor [Sean Whitton](https://wiki.debian.org/SeanWhitton), users of Debian 9 or later or Ubuntu 16.04 or later may simply `apt-get install xul-ext-ublock-origin`. From 6aa5e430399bc24196567dba288a823c77357cf5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 7 Dec 2016 10:05:29 -0500 Subject: [PATCH 12/23] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0aed9e4bb4a0e..a19148e4148fa 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ uBlock Origin * [Chromium](#chromium) * [Firefox](#firefox--firefox-for-android) * [Microsoft Edge](#microsoft-edge) + - [Safari (macOS)](#safari-macos) * [Release History](#release-history) * [Privacy policy](https://github.com/gorhill/uBlock/wiki/Privacy-policy) * [Wiki](https://github.com/gorhill/uBlock/wiki) @@ -133,10 +134,6 @@ The Firefox version of uBlock Origin has [an extra feature](https://github.com/g Also of interest: [Deploying uBlock Origin for Firefox with CCK2 and Group Policy](http://decentsecurity.com/ublock-for-firefox-deployment/). -#### Safari (macOS) - -Early development version: . - #### Debian / Ubuntu Thanks to Debian contributor [Sean Whitton](https://wiki.debian.org/SeanWhitton), users of Debian 9 or later or Ubuntu 16.04 or later may simply @@ -146,6 +143,10 @@ Thanks to Debian contributor [Sean Whitton](https://wiki.debian.org/SeanWhitton) Early development version by [@nikrolls](https://github.com/nikrolls): . +#### Safari (macOS) + +Early development versionby [@el1t](https://github.com/el1t): . + #### Note for all browsers To benefit from uBlock Origin's higher efficiency, it's advised that you don't use other inefficient blockers at the same time (such as AdBlock or Adblock Plus). uBlock₀ will do [as well or better](#blocking) than most popular ad blockers. From b45b916a7c8f8a3a019380ec76c6a1af7652d36d Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 7 Dec 2016 10:07:39 -0500 Subject: [PATCH 13/23] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index a19148e4148fa..62330fcbe7c1c 100644 --- a/README.md +++ b/README.md @@ -134,8 +134,6 @@ The Firefox version of uBlock Origin has [an extra feature](https://github.com/g Also of interest: [Deploying uBlock Origin for Firefox with CCK2 and Group Policy](http://decentsecurity.com/ublock-for-firefox-deployment/). -#### Debian / Ubuntu - Thanks to Debian contributor [Sean Whitton](https://wiki.debian.org/SeanWhitton), users of Debian 9 or later or Ubuntu 16.04 or later may simply `apt-get install xul-ext-ublock-origin`. From 2f4c6777867726ea5b0a6a9de44f27d2dbdae5f0 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 7 Dec 2016 10:08:11 -0500 Subject: [PATCH 14/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62330fcbe7c1c..6a11cb3d8c920 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Early development version by [@nikrolls](https://github.com/nikrolls): . +Early development version by [@el1t](https://github.com/el1t): . #### Note for all browsers From df7dedfed1bad1e5d803d7f0d06d61ecd08f089c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 7 Dec 2016 12:56:20 -0500 Subject: [PATCH 15/23] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6545dfed9195b..b3ef10f656f5c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ For **support/discussions**, there is [Mozilla Discourse](https://discourse.mozi For **filter-related issues**, report on the respective filter list support site, or at [uBlockOrigin/uAssets](https://github.com/uBlockOrigin/uAssets/issues). Use [the logger](https://github.com/gorhill/uBlock/wiki/The-logger) to diagnose/confirm filter-related issues. If something does not work properly with uBO enabled, the **first step** is to rule out filter-related issues. -Ignorance of the above rules is no excuse: **Opening an issue for purpose of support or discussion, or opening a filter-related issue will result in the user being immediately blocked.** Given the [amount of invalid issues being opened](https://github.com/gorhill/uBlock/issues?q=is%3Aissue+label%3Ainvalid+is%3Aclosed), I have no choice but to resort to such a drastic measure. +Ignorance of the above rules is no excuse: **Opening an issue for purpose of support or discussion, or opening a filter-related issue will result in the user being immediately blocked.** Given the [amount of invalid issues being opened](https://github.com/gorhill/uBlock/issues?q=is%3Aissue+label%3Ainvalid+is%3Aclosed), I have no choice but to resort to such a drastic measure. You will still be able to open filter list issues at [uBlockOrigin/uAssets](https://github.com/uBlockOrigin/uAssets/issues). **The issue tracker is for provable issues only:** You will have to make the case that the issue is really with uBlock Origin and not something else on your side. To make a case means to provide detailed steps so that anybody can reproduce the issue. Be sure to rule out that the issue is not caused by something specific on your side. From c3c92f85ff569d0601c3fec67d932abde189e1f4 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 20:18:58 -0500 Subject: [PATCH 16/23] fix #2225 --- src/js/static-net-filtering.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index d62036bbe391b..4d6550b4b9fef 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -2201,6 +2201,10 @@ FilterContainer.prototype.matchTokens = function(bucket, url) { FilterContainer.prototype.matchStringGenericHide = function(context, requestURL) { var url = this.urlTokenizer.setURL(requestURL); + // https://github.com/gorhill/uBlock/issues/2225 + // Important: this is used by FilterHostnameDict.match(). + requestHostnameRegister = µb.URI.hostnameFromURI(url); + var bucket = this.categories.get(toHex(genericHideException)); if ( !bucket || this.matchTokens(bucket, url) === false ) { this.fRegister = null; @@ -2282,7 +2286,7 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r // If there is no block filter, no need to test against allow filters if ( this.fRegister === null ) { - return undefined; + return; } // Test against allow filters @@ -2419,7 +2423,7 @@ FilterContainer.prototype.matchString = function(context) { // If there is no block filter, no need to test against allow filters if ( this.fRegister === null ) { - return undefined; + return; } // Test against allow filters From 9bc6b5b2feb25c06018c8757c9d4248db8af03a2 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 20:22:07 -0500 Subject: [PATCH 17/23] new revision for release candidate --- platform/chromium/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index 528b32d2df112..f32c7633335a3 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.10.1.1", + "version": "1.10.1.100", "default_locale": "en", "description": "__MSG_extShortDesc__", From 4a4de32bba617a72bd02ed49c289863b365bfb2c Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 7 Dec 2016 23:59:10 -0500 Subject: [PATCH 18/23] fix #2226 --- platform/firefox/vapi-background.js | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index d01eb9a3637db..36964825e0652 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1900,6 +1900,7 @@ var httpObserver = { 16: 'websocket', 17: 'csp_report', 19: 'beacon', + 20: 'xmlhttprequest', 21: 'image' }, onBeforeRequest: function(){}, From 289611173c03a5e43a66d9b708d863fd7b542e54 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 8 Dec 2016 00:03:57 -0500 Subject: [PATCH 19/23] new revision for release candidate --- platform/chromium/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index f32c7633335a3..923de765bb35e 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.10.1.100", + "version": "1.10.1.101", "default_locale": "en", "description": "__MSG_extShortDesc__", From b256a48bd100922f8173993c20189114633585de Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 13 Dec 2016 14:03:43 -0500 Subject: [PATCH 20/23] fix https://github.com/nikrolls/uBlock-Edge/issues/34 --- src/css/popup.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/css/popup.css b/src/css/popup.css index 2e8dfefc96749..b647aa3d10f70 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -134,6 +134,7 @@ p { } #switch { margin: 8px 0; + user-select: none; } #switch .fa { color: #0046ff; From a29b76f3adfa17f5a6681937965ae7a44f2aba8f Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 14 Dec 2016 07:34:36 -0500 Subject: [PATCH 21/23] fix https://github.com/nikrolls/uBlock-Edge/issues/34 --- src/css/common.css | 3 +++ src/css/popup.css | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/css/common.css b/src/css/common.css index ab51b32d87ff7..255d1d18e245d 100644 --- a/src/css/common.css +++ b/src/css/common.css @@ -10,6 +10,9 @@ font-style: normal; font-weight: normal; line-height: 1; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; vertical-align: middle; } body { diff --git a/src/css/popup.css b/src/css/popup.css index b647aa3d10f70..2e8dfefc96749 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -134,7 +134,6 @@ p { } #switch { margin: 8px 0; - user-select: none; } #switch .fa { color: #0046ff; From acd27b07ec67799b79fa9a09013e2c528aa77027 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 14 Dec 2016 07:50:52 -0500 Subject: [PATCH 22/23] trabslation work from https://crowdin.com/project/ublock --- src/_locales/el/messages.json | 16 ++++++++-------- src/_locales/zh_CN/messages.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/_locales/el/messages.json b/src/_locales/el/messages.json index f7ec275ab552e..ad9818a10af18 100644 --- a/src/_locales/el/messages.json +++ b/src/_locales/el/messages.json @@ -44,7 +44,7 @@ "description":"Title for the advanced settings page" }, "popupPowerSwitchInfo":{ - "message":"Κλικ: απενεργοποίηση\/ενεργοποίηση του uBlock για αυτόν τον ιστότοπο.\n\nCtrl+κλικ: απενεργοποίηση του µBlock μόνο για αυτήν την σελίδα.", + "message":"Κλικ: απενεργοποίηση\/ενεργοποίηση του uBlock₀ για αυτόν τον ιστότοπο.\n\nCtrl+κλικ: απενεργοποίηση του uBlock₀ μόνο για αυτήν την σελίδα.", "description":"English: Click: disable\/enable uBlock₀ for this site.\n\nCtrl+click: disable uBlock₀ only on this page." }, "popupBlockedRequestPrompt":{ @@ -100,7 +100,7 @@ "description":"Tooltip when hovering the top-most cell of the global-rules column." }, "popupTipLocalRules":{ - "message":"Τοπικοί κανόνες: αυτή η στήλη είναι για κανόνες με εφαρμογή στην τρέχουσα τοποθεσία μόνον.\nΟι τοπικοί κανόνες παραμερίζουν τους καθολικούς κανόνες.", + "message":"Τοπικοί κανόνες: αυτή η στήλη είναι για κανόνες με εφαρμογή στην τρέχουσα τοποθεσία μόνο.\nΟι τοπικοί κανόνες παραμερίζουν τους καθολικούς κανόνες.", "description":"Tooltip when hovering the top-most cell of the local-rules column." }, "popupTipSaveRules":{ @@ -124,7 +124,7 @@ "description":"" }, "popup3pPassiveRulePrompt":{ - "message":"Css\/Εικόνες τρίτου μέρους", + "message":"3ου μέρους css\/Εικόνες", "description":"" }, "popupInlineScriptRulePrompt":{ @@ -200,7 +200,7 @@ "description":"English: Make use of context menu where appropriate" }, "settingsColorBlindPrompt":{ - "message":"Λειτουργία φιλική πρως χρήστες με αχρωματοψία", + "message":"Λειτουργία φιλική προς χρήστες με αχρωματοψία", "description":"English: Color-blind friendly" }, "settingsCloudStorageEnabledPrompt":{ @@ -240,7 +240,7 @@ "description":"" }, "settingsNoLargeMediaPrompt":{ - "message":"Φραγή στοιχείων πολυμέσων μεγαλύτερων από {{εισαγωγή:αριθμός}} kB", + "message":"Φραγή στοιχείων πολυμέσων μεγαλύτερων από {{input:number}} kB", "description":"" }, "settingsNoRemoteFontsPrompt":{ @@ -492,7 +492,7 @@ "description":"Small header to identify the static filtering section" }, "loggerStaticFilteringSentence":{ - "message":"{{action}} το δήκτυο αιτεί {{type}} {{br}} του οποίου η διεύθηνση ταιριάζει {{url}} {{br}} και το οποίο προέρχεται {{origin}},{{br}}{{importance}} υπάρχει ένα ταιριαστό φίλτρο εξαίρεση.", + "message":"{{action}} τα δικτυακά αιτήματα {{type}} {{br}} των οποίων η διεύθυνση ταιριάζει με {{url}} {{br}} και προέρχεται από {{origin}},{{br}}{{importance}} υπάρχει ένα ταιριαστό φίλτρο για εξαίρεση.", "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartBlock":{ @@ -520,7 +520,7 @@ "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartNotImportant":{ - "message":"εκτός εάν", + "message":"εκτός όταν", "description":"Used in the static filtering wizard" }, "loggerStaticFilteringSentencePartImportant":{ @@ -676,7 +676,7 @@ "description":"" }, "cloudDeviceNamePrompt":{ - "message":"Το όνομα της συσκευής:", + "message":"Το όνομα αυτής της συσκευής:", "description":"used as a prompt for the user to provide a custom device name" }, "advancedSettingsWarning":{ diff --git a/src/_locales/zh_CN/messages.json b/src/_locales/zh_CN/messages.json index 26bc31775e73b..9a753bad9c379 100644 --- a/src/_locales/zh_CN/messages.json +++ b/src/_locales/zh_CN/messages.json @@ -424,7 +424,7 @@ "description":"English: dynamic rule syntax and full documentation." }, "whitelistPrompt":{ - "message":"您的列表中针对 uBlock₀ 的主机名将被禁用。一行一条规则。无效的主机名将直接被忽略。", + "message":"uBlock₀ 在列表里的城名将会停用。一行一条规则。无效的城名将直接被忽略。", "description":"English: An overview of the content of the dashboard's Whitelist pane." }, "whitelistImport":{ From f30b31ff1e354db16dc1ffc0920ef1f112d1fb90 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 14 Dec 2016 07:51:20 -0500 Subject: [PATCH 23/23] new revision for release --- platform/chromium/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index 923de765bb35e..2d6015ddab486 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "uBlock Origin", - "version": "1.10.1.101", + "version": "1.10.2", "default_locale": "en", "description": "__MSG_extShortDesc__",