From 7702b1f4bc8aaaf291b4aa7bc9c4409f0b38c044 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 25 Jul 2018 18:24:14 -0400 Subject: [PATCH 1/7] minor code review --- src/js/storage.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/js/storage.js b/src/js/storage.js index 397cb77a0a538..f8c429db7bb39 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -54,11 +54,6 @@ µBlock.saveLocalSettings = (function() { let saveAfter = 4 * 60 * 1000; - let save = function(callback) { - this.localSettingsLastSaved = Date.now(); - vAPI.storage.set(this.localSettings, callback); - }; - let onTimeout = ( ) => { let µb = µBlock; if ( µb.localSettingsLastModified > µb.localSettingsLastSaved ) { @@ -69,7 +64,10 @@ vAPI.setTimeout(onTimeout, saveAfter); - return save; + return function(callback) { + this.localSettingsLastSaved = Date.now(); + vAPI.storage.set(this.localSettings, callback); + }; })(); /******************************************************************************/ From 05432888896cc60892d2d750160bf3bfa35575f9 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 26 Jul 2018 10:24:10 -0400 Subject: [PATCH 2/7] import translation work from https://github.com/gorhill/uBlock --- src/_locales/es/messages.json | 4 ++-- src/_locales/hi/messages.json | 10 +++++----- src/_locales/ka/messages.json | 2 +- src/_locales/nb/messages.json | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json index 381f437de9a38..99e20df14246a 100644 --- a/src/_locales/es/messages.json +++ b/src/_locales/es/messages.json @@ -256,7 +256,7 @@ "description": "" }, "settingsAdvancedUserPrompt": { - "message": "Soy usuario avanzado ( Lectura Obligatoria - Inglés<\/a>)", + "message": "Soy usuario avanzado (lectura obligatoria en inglés<\/a>)", "description": "" }, "settingsAdvancedUserSettings": { @@ -624,7 +624,7 @@ "description": "Text for button to create a backup of all settings" }, "aboutBackupFilename": { - "message": "ublock-respaldo_{{datetime}}.txt", + "message": "ublock-mi-respaldo_{{datetime}}.txt", "description": "English: my-ublock-backup_{{datetime}}.txt" }, "aboutRestoreDataButton": { diff --git a/src/_locales/hi/messages.json b/src/_locales/hi/messages.json index 9199bd4388c6f..398c4b3b7adb6 100644 --- a/src/_locales/hi/messages.json +++ b/src/_locales/hi/messages.json @@ -32,7 +32,7 @@ "description": "appears as tab name in dashboard" }, "shortcutsPageName": { - "message": "Shortcuts", + "message": "शॉर्टकट", "description": "appears as tab name in dashboard" }, "statsPageName": { @@ -124,11 +124,11 @@ "description": "Tooltip for the no-cosmetic-filtering per-site switch" }, "popupTipNoCosmeticFiltering1": { - "message": "Click to disable cosmetic filtering on this site", + "message": "इस साइट पर कॉस्मेटिक फ़िल्टरिंग अक्षम करने के लिए क्लिक करें", "description": "Tooltip for the no-cosmetic-filtering per-site switch" }, "popupTipNoCosmeticFiltering2": { - "message": "Click to enable cosmetic filtering on this site", + "message": "इस साइट पर कॉस्मेटिक फ़िल्टरिंग सक्षम करने के लिए क्लिक करें", "description": "Tooltip for the no-cosmetic-filtering per-site switch" }, "popupTipNoRemoteFonts": { @@ -136,7 +136,7 @@ "description": "Tooltip for the no-remote-fonts per-site switch" }, "popupTipNoRemoteFonts1": { - "message": "Click to block remote fonts on this site", + "message": "इस साइट पर रिमोट फोंट को अवरुद्ध करने के लिए क्लिक करें", "description": "Tooltip for the no-remote-fonts per-site switch" }, "popupTipNoRemoteFonts2": { @@ -732,7 +732,7 @@ "description": "tooltip" }, "cloudPull": { - "message": "Import from cloud storage", + "message": "क्लाउड स्टोरेज से आयात करें", "description": "tooltip" }, "cloudPullAndMerge": { diff --git a/src/_locales/ka/messages.json b/src/_locales/ka/messages.json index 6dc4aba1d6b1a..6fe8c4c6ce07e 100644 --- a/src/_locales/ka/messages.json +++ b/src/_locales/ka/messages.json @@ -592,7 +592,7 @@ "description": "Below this sentence, the filter list(s) in which the filter was found" }, "loggerStaticFilteringFinderSentence2": { - "message": "Static filter {{filter}}<\/code> could not be found in any of the currently enabled filter lists", + "message": "მუდმივი ფილტრი {{filter}}<\/code> ვერ მოიძებნა ამჟამად გამოყენებულ ფილტრებს შორის", "description": "Message to show when a filter cannot be found in any filter lists" }, "aboutChangelog": { diff --git a/src/_locales/nb/messages.json b/src/_locales/nb/messages.json index 4ef8c91d02af3..944f58a2749de 100644 --- a/src/_locales/nb/messages.json +++ b/src/_locales/nb/messages.json @@ -32,7 +32,7 @@ "description": "appears as tab name in dashboard" }, "shortcutsPageName": { - "message": "Shortcuts", + "message": "Snarveier", "description": "appears as tab name in dashboard" }, "statsPageName": { @@ -592,7 +592,7 @@ "description": "Below this sentence, the filter list(s) in which the filter was found" }, "loggerStaticFilteringFinderSentence2": { - "message": "Static filter {{filter}}<\/code> could not be found in any of the currently enabled filter lists", + "message": "Statisk filter {{filter}}<\/code> ble ikke funnet i noen av filterlistene som er aktiverte nå", "description": "Message to show when a filter cannot be found in any filter lists" }, "aboutChangelog": { @@ -772,7 +772,7 @@ "description": "A context menu entry, present when large media elements have been blocked on the current site" }, "shortcutCapturePlaceholder": { - "message": "Type a shortcut", + "message": "Oppfør en snarvei", "description": "Placeholder string for input field used to capture a keyboard shortcut" }, "dummy": { From 756288294ddfe66e4ec2fe73367d24328931e53f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 26 Jul 2018 11:30:09 -0400 Subject: [PATCH 3/7] make Firefox dev build auto-update --- dist/firefox/updates.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/firefox/updates.json b/dist/firefox/updates.json index 6cd8f33599b11..fa5ba57b6d199 100644 --- a/dist/firefox/updates.json +++ b/dist/firefox/updates.json @@ -3,10 +3,10 @@ "uBlock0@raymondhill.net": { "updates": [ { - "version": "1.16.15.5", + "version": "1.16.15.6", "applications": { "gecko": { "strict_min_version": "52" } }, - "update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.16.15b5", - "update_link": "https://github.com/gorhill/uBlock/releases/download/1.16.15b5/uBlock0.firefox.signed.xpi" + "update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.16.15b6", + "update_link": "https://github.com/gorhill/uBlock/releases/download/1.16.15b6/uBlock0.firefox.signed.xpi" } ] } From ec8e1cca157c250534483accad62d82a174cf1c2 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 30 Jul 2018 08:56:51 -0400 Subject: [PATCH 4/7] fix https://github.com/uBlockOrigin/uBlock-issues/issues/149 --- src/js/i18n.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/js/i18n.js b/src/js/i18n.js index d10be88d857d9..cdd0bb48ef1cd 100644 --- a/src/js/i18n.js +++ b/src/js/i18n.js @@ -79,16 +79,27 @@ var safeTextToTagNode = function(text) { } }; -var safeTextToTextNode = function(text) { - // TODO: remove once no more HTML entities in translation files. - if ( text.indexOf('&') !== -1 ) { - text = text.replace(/“/g, '“') - .replace(/”/g, '”') - .replace(/‘/g, '‘') - .replace(/’/g, '’'); - } - return document.createTextNode(text); -}; +var safeTextToTextNode = (function() { + let entities = new Map([ + // TODO: Remove quote entities once no longer present in translation + // files. Other entities must stay. + [ '“', '“' ], + [ '”', '”' ], + [ '‘', '‘' ], + [ '’', '’' ], + [ '<', '<' ], + [ '>', '>' ], + ]); + let decodeEntities = match => { + return entities.get(match) || match; + }; + return function(text) { + if ( text.indexOf('&') !== -1 ) { + text = text.replace(/&[a-z]+;/g, decodeEntities); + } + return document.createTextNode(text); + }; +})(); var safeTextToDOM = function(text, parent) { if ( text === '' ) { return; } From 5732d84073ccae49943c4b867d0ffb929b9e9faf Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 2 Aug 2018 17:56:35 -0400 Subject: [PATCH 5/7] new revision for release candidate --- dist/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/version b/dist/version index 6991718f64df4..dcb210970c642 100644 --- a/dist/version +++ b/dist/version @@ -1 +1 @@ -1.16.15.6 +1.16.15.100 From a20498b5c02b6e55e32ffe5ede829249cbdedeac Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 2 Aug 2018 17:59:24 -0400 Subject: [PATCH 6/7] import translation work from https://crowdin.com/project/ublock --- dist/description/description-es.txt | 6 +++--- src/_locales/es/messages.json | 22 +++++++++++----------- src/_locales/et/messages.json | 4 ++-- src/_locales/id/messages.json | 2 +- src/_locales/ko/messages.json | 2 +- src/_locales/pl/messages.json | 12 ++++++------ src/_locales/pt_PT/messages.json | 2 +- src/_locales/ro/messages.json | 6 +++--- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dist/description/description-es.txt b/dist/description/description-es.txt index 16fe1a3639e92..530e09abad570 100644 --- a/dist/description/description-es.txt +++ b/dist/description/description-es.txt @@ -6,12 +6,12 @@ Uso: El botón grande de apagado/encendido en la ventana de la aplicación, es p *** -Flexible, es más que un "ad blocker": también puede leer y crear filtros desde archivos hosts. +Flexible, es más que un "bloqueador de anuncios": también puede leer y crear filtros desde archivos hosts. Por defecto ya trae configuradas las siguientes listas de filtros: - EasyList -- Lista de servidores de anuncios de Peter Lowe +- Peter Lowe’s Ad server list - EasyPrivacy - Malware domains @@ -22,7 +22,7 @@ Otras listas disponibles pueden ser seleccionadas, si se desea: - hpHosts’s Ad and tracking servers - MVPS HOSTS - Spam404 -- Etc. +- Y muchas más Por supuesto, mientras más filtros se activen, mayor será el consumo de memoria. No obstante, incluso después de agregar las dos listas adicionales de Fanboy y la 'hpHosts’s Ad and tracking servers', uBlock₀ consume menos memoria que otros bloqueadores similares. diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json index 99e20df14246a..62b81ee21f988 100644 --- a/src/_locales/es/messages.json +++ b/src/_locales/es/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "uBlock₀", + "message": "uBlock Origin", "description": "extension name." }, "extShortDesc": { @@ -28,7 +28,7 @@ "description": "appears as tab name in dashboard" }, "whitelistPageName": { - "message": "Lista blanca", + "message": "Lista de permitidos", "description": "appears as tab name in dashboard" }, "shortcutsPageName": { @@ -44,11 +44,11 @@ "description": "appears as tab name in dashboard" }, "advancedSettingsPageName": { - "message": "Ajustes avanzados", + "message": "Configuración avanzada", "description": "Title for the advanced settings page" }, "popupPowerSwitchInfo": { - "message": "Clic: desactivar\/activar uBlock₀ para este sitio.\n\nCtrl + clic: deshabilitar uBlock₀ sólo en esta página.", + "message": "Clic: deshabilitar\/habilitar uBlock₀ para este sitio.\n\nCtrl + clic: deshabilitar uBlock₀ sólo en esta página.", "description": "English: Click: disable\/enable uBlock₀ for this site.\n\nCtrl+click: disable uBlock₀ only on this page." }, "popupPowerSwitchInfo1": { @@ -96,7 +96,7 @@ "description": "Tooltip used for the logger icon in the panel" }, "popupTipNoPopups": { - "message": "Alternar bloqueo de todos los pop-ups para este sitio", + "message": "Alternar bloqueo de ventanas emergentes en este sitio", "description": "Tooltip for the no-popups per-site switch" }, "popupTipNoPopups1": { @@ -260,7 +260,7 @@ "description": "" }, "settingsAdvancedUserSettings": { - "message": "ajustes avanzados", + "message": "configuración avanzada", "description": "For the tooltip of a link which gives access to advanced settings" }, "settingsPrefetchingDisabledPrompt": { @@ -476,11 +476,11 @@ "description": "English: List of your dynamic filtering rules." }, "rulesFormatHint": { - "message": "Sintaxis de las reglas: origen destino tipo acción<\/code> ( documentación completa<\/a>).", + "message": "Sintaxis de las reglas: origen destino tipo acción<\/code> (documentación completa<\/a>).", "description": "English: dynamic rule syntax and full documentation." }, "whitelistPrompt": { - "message": "Lista de servidores para los cuales se deshabilitará uBlock₀. Una entrada por línea. Se omitirán nombres de servidores inválidos.", + "message": "Lista de permitidos de páginas web para los cuales se deshabilitará uBlock₀. Una entrada por línea. Se omitirán nombres de páginas web inválidos.", "description": "English: An overview of the content of the dashboard's Whitelist pane." }, "whitelistImport": { @@ -516,7 +516,7 @@ "description": "English: Filter" }, "logAll": { - "message": "Todas", + "message": "Todo", "description": "Appears in the logger's tab selector" }, "logBehindTheScene": { @@ -716,7 +716,7 @@ "description": "English: Close this window" }, "docblockedProceed": { - "message": "Deshabilitar bloqueo estricto para {{hostname}}", + "message": "Deshabilitar bloqueo estricto para {{hostname}}", "description": "English: Disable strict blocking for {{hostname}} ..." }, "docblockedDisableTemporary": { @@ -748,7 +748,7 @@ "description": "used as a prompt for the user to provide a custom device name" }, "advancedSettingsWarning": { - "message": "¡Alerta! Cambie estos ajustes avanzados bajo su propio riesgo.", + "message": "¡Alerta! Cambie estas configuraciones avanzadas bajo su propio riesgo.", "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 e36adab255de9..308c0e14dbc7e 100644 --- a/src/_locales/et/messages.json +++ b/src/_locales/et/messages.json @@ -36,7 +36,7 @@ "description": "appears as tab name in dashboard" }, "statsPageName": { - "message": "uBlock₀ — Võrgutaotluste logi", + "message": "uBlock₀ — Logija", "description": "Title for the logger window" }, "aboutPageName": { @@ -92,7 +92,7 @@ "description": "English: Enter element picker mode" }, "popupTipLog": { - "message": "Avage logija", + "message": "Ava logija", "description": "Tooltip used for the logger icon in the panel" }, "popupTipNoPopups": { diff --git a/src/_locales/id/messages.json b/src/_locales/id/messages.json index 7f8281b28eb3a..4ad8cfdaeba4c 100644 --- a/src/_locales/id/messages.json +++ b/src/_locales/id/messages.json @@ -592,7 +592,7 @@ "description": "Below this sentence, the filter list(s) in which the filter was found" }, "loggerStaticFilteringFinderSentence2": { - "message": "Static filter {{filter}}<\/code> could not be found in any of the currently enabled filter lists", + "message": "Filter statis {{filter}}<\/code> tidak dapat ditemukan di salah satu daftar filter yang aktif saat ini", "description": "Message to show when a filter cannot be found in any filter lists" }, "aboutChangelog": { diff --git a/src/_locales/ko/messages.json b/src/_locales/ko/messages.json index 1a72700003722..637cbcfd3163a 100644 --- a/src/_locales/ko/messages.json +++ b/src/_locales/ko/messages.json @@ -32,7 +32,7 @@ "description": "appears as tab name in dashboard" }, "shortcutsPageName": { - "message": "Shortcuts", + "message": "단축키", "description": "appears as tab name in dashboard" }, "statsPageName": { diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json index 0a3182de542ec..06d9f5b7ba775 100644 --- a/src/_locales/pl/messages.json +++ b/src/_locales/pl/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "uBlock₀", + "message": "uBlock Origin", "description": "extension name." }, "extShortDesc": { @@ -36,7 +36,7 @@ "description": "appears as tab name in dashboard" }, "statsPageName": { - "message": "uBlock — Dziennik żądań sieciowych", + "message": "uBlock₀ – Dziennik żądań sieciowych", "description": "Title for the logger window" }, "aboutPageName": { @@ -240,7 +240,7 @@ "description": "English: Show the number of blocked requests on the icon" }, "settingsTooltipsPrompt": { - "message": "Nie wyświetlaj podpowiedzi", + "message": "Nie wyświetlaj dymków podpowiedzi", "description": "A checkbox in the Settings pane" }, "settingsContextMenuPrompt": { @@ -268,7 +268,7 @@ "description": "English: " }, "settingsHyperlinkAuditingDisabledPrompt": { - "message": "Nie śledź kliknięć odnośników", + "message": "Wyłącz śledzenie kliknięć odnośników", "description": "English: " }, "settingsWebRTCIPAddressHiddenPrompt": { @@ -692,7 +692,7 @@ "description": "Firefox-specific: appears as 'uBlock₀ (off)'" }, "docblockedPrompt1": { - "message": "uBlock₀ zablokował wczytywanie następującej strony:", + "message": "uBlock Origin zablokował wczytywanie następującej strony:", "description": "English: uBlock₀ has prevented the following page from loading:" }, "docblockedPrompt2": { @@ -716,7 +716,7 @@ "description": "English: Close this window" }, "docblockedProceed": { - "message": "Wyłącz skrupulatne blokowanie na {{hostname}}", + "message": "Wyłącz rygorystyczne blokowanie dla {{hostname}}", "description": "English: Disable strict blocking for {{hostname}} ..." }, "docblockedDisableTemporary": { diff --git a/src/_locales/pt_PT/messages.json b/src/_locales/pt_PT/messages.json index 7ddd0867b10df..a26b8bdaa4f26 100644 --- a/src/_locales/pt_PT/messages.json +++ b/src/_locales/pt_PT/messages.json @@ -772,7 +772,7 @@ "description": "A context menu entry, present when large media elements have been blocked on the current site" }, "shortcutCapturePlaceholder": { - "message": "Digite um atalho", + "message": "Digitar um atalho", "description": "Placeholder string for input field used to capture a keyboard shortcut" }, "dummy": { diff --git a/src/_locales/ro/messages.json b/src/_locales/ro/messages.json index ed3b8f1ea3677..f60a21532e051 100644 --- a/src/_locales/ro/messages.json +++ b/src/_locales/ro/messages.json @@ -32,7 +32,7 @@ "description": "appears as tab name in dashboard" }, "shortcutsPageName": { - "message": "Shortcuts", + "message": "Comenzi rapide", "description": "appears as tab name in dashboard" }, "statsPageName": { @@ -592,7 +592,7 @@ "description": "Below this sentence, the filter list(s) in which the filter was found" }, "loggerStaticFilteringFinderSentence2": { - "message": "Static filter {{filter}}<\/code> could not be found in any of the currently enabled filter lists", + "message": "Filtru static {{filter}}<\/code> nu se gasește în niciuna dintre listele de filtre activate", "description": "Message to show when a filter cannot be found in any filter lists" }, "aboutChangelog": { @@ -772,7 +772,7 @@ "description": "A context menu entry, present when large media elements have been blocked on the current site" }, "shortcutCapturePlaceholder": { - "message": "Type a shortcut", + "message": "Tastați o comandă rapidă", "description": "Placeholder string for input field used to capture a keyboard shortcut" }, "dummy": { From b34c897553671a5fd4d4ec9e5d39b9a106c107be Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 2 Aug 2018 18:02:29 -0400 Subject: [PATCH 7/7] make Firefox dev build auto-update --- dist/firefox/updates.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/firefox/updates.json b/dist/firefox/updates.json index fa5ba57b6d199..0824c7d91b06f 100644 --- a/dist/firefox/updates.json +++ b/dist/firefox/updates.json @@ -3,10 +3,10 @@ "uBlock0@raymondhill.net": { "updates": [ { - "version": "1.16.15.6", + "version": "1.16.15.100", "applications": { "gecko": { "strict_min_version": "52" } }, - "update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.16.15b6", - "update_link": "https://github.com/gorhill/uBlock/releases/download/1.16.15b6/uBlock0.firefox.signed.xpi" + "update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.16.15rc0", + "update_link": "https://github.com/gorhill/uBlock/releases/download/1.16.15rc0/uBlock0.firefox.signed.xpi" } ] }