Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1 from NanoAdblocker/master
Browse files Browse the repository at this point in the history
Update from upstream repo NanoAdblocker/NanoCore@master
  • Loading branch information
LiCybora authored Jun 13, 2018
2 parents 80672ef + e0b6c8c commit 271e5c6
Show file tree
Hide file tree
Showing 48 changed files with 1,102 additions and 897 deletions.
2 changes: 1 addition & 1 deletion README.md.old
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ uBlock Origin (or uBlock₀) is not an *ad blocker*; it's a general-purpose bloc

That said, it's important to note that using a blocker is **NOT** [theft](https://twitter.com/LeaVerou/status/518154828166725632). Don't fall for this creepy idea. The _ultimate_ logical consequence of `blocking = theft` is the criminalisation of the inalienable right to privacy.

Ads, "unintrusive" or not, are just the visible portions of privacy-invading apparatus entering your browser when you visit most sites nowadays. **uBlock Origin's main goal is to help users neutralize such privacy-invading apparatus** — in a way that welcomes those users who don't wish to use more technical, involved means (such as [µMatrix](https://github.com/gorhill/uMatrix)).
Ads, "unintrusive" or not, are just the visible portions of privacy-invading apparatus entering your browser when you visit most sites nowadays. **uBlock Origin's main goal is to help users neutralize such privacy-invading apparatus** — in a way that welcomes those users who don't wish to use more technical, involved means (such as [uMatrix](https://github.com/gorhill/uMatrix)).

_EasyList_, _Peter Lowe's Adservers_, _EasyPrivacy_ and _Malware domains_ are enabled by default when you install uBlock Origin. Many more lists are readily available to block trackers, analytics, and more. Hosts files are also supported.

Expand Down
18 changes: 9 additions & 9 deletions dist/description/description-bg.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
Ефикасен блокер: с малко използване на паметта и процесора, но същевременно способен да зарежда и налага хиляди допълнителни филтри в сравнение с други популярни блокери.
Действащ блокер: щадящ паметта и процесора, но и способен да зареди и наложи хиляди филтри в сравнение с други популярни блокери.

Илюстрация на неговата ефикасност: https://github.com/gorhill/uBlock/wiki/uBlock-vs.-ABP:-efficiency-compared

Използване: Големият бутон за "Включване" в изскачащият прозорец служи за трайно включване/изключване на uBlock за текущия сайт. Той се отнася само за текущия сайт, не е глобален бутон за включване.
Използване: големият бутон за включване в изскачащия прозорец забранява/разрешава uBlock в текущия сайт. Приложим само за текущия сайт, не действа глобално.

***

Гъвкав, той е повече от "блокер на реклами": може да чете и създава филтри от хост файлове.
Гъвкав, нещо повече от блокер на реклами“: чете и създава филтри на базата на файлове с хостове.

При първоначално използване са заредени и наложени следните списъци с филтри:
Първоначално са заредени и наложени следните филтри:

- EasyList
- Списък с рекламни сървъри от Peter Lowe
- списък с рекламни сървъри от Peter Lowe
- EasyPrivacy
- Вредоносни домейни
- вредоносни домейни

Aко желаете, на разположение са допълнителни списъци, които да изберете:

- разширен проследяващ списък от Fanboy
- хост файл от Dan Pollock
- файл с хостове от Dan Pollock
- рекламни и проследяващи сървъри от hpHosts
- MVPS HOSTS
- Spam404
- и много други

Разбира се, колкото повече списъци включите, толкова по-голямо е използването на паметта. Въпреки това, дори и след добавяне на двата допълнителни списъка от Fanboy, рекламните и проследяващи сървъри от hpHosts, uBlock₀ използва по-малко памет в сравнение с други много популярни блокери.

Също така, имайте предвид, че избирането на някои от допълнителните списъци може да доведе до по-голяма вероятност от неправилно функциониране на уебсайтове -- особено тези списъци, които по принцип се използват като хост файлове.
Имайте също така предвид, че избирането на определени допълнителни списъци може да доведе с голяма степен на вероятност до неправилно функциониране на сайтовете — особено тези, които по принцип се ползват като файл с хостове.

***

Expand All @@ -36,7 +36,7 @@ Aко желаете, на разположение са допълнителн

Безплатно.
Отворен код с публичен лиценз (GPLv3)
За потребители от потребителите.
За потребители от потребители.

Сътрудници @ Github: https://github.com/gorhill/uBlock/graphs/contributors
Сътрудници @ Crowdin: https://crowdin.net/project/ublock
Expand Down
10 changes: 5 additions & 5 deletions dist/description/description-ca.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Un bloquejador eficient: amb un consum discret de memòria i de processador, pot carregar i aplicar milers de filtres més que altres aplicacions semblants.
Un blocador eficient: Amb un consum discret de memòria i de processador, podeu carregar i aplicar milers de filtres més que altres aplicacions semblants.

Gràfic de l'eficiència: https://github.com/gorhill/uBlock/wiki/uBlock-vs.-ABP:-efficiency-compared

Ús: el botó gran d'engegada de la finestra emergent serveix per a desactivar/activar permanentment l'uBlock per al lloc web actual. Només s'aplica al lloc web actual, no és un botó d'engegada global.
Ús: el botó gran d'engegada de la finestra emergent serveix per a habilitar/inhabilitar permanentment l'uBlock el lloc web actual. Només s'aplica al lloc web actual, no és un botó d'engegada global.

***

Expand All @@ -22,11 +22,11 @@ Si voleu, podeu seleccionar altres llistes disponibles:
- hpHosts’s Ad and tracking servers
- MVPS HOSTS
- Spam404
- I moltes més
- I molts més

Per descomptat, com més filtres activeu, més gran serà el consum de memòria. Però fins i tot després d'afegir les dues llistes extra de Fanboy, els servidors d'anuncis i rastreig d'hpHosts, l'uBlock encara té un consum de memòria inferior al d'altres bloquejadors coneguts.
Òbviament, com més filtres activeu, més gran serà el consum de memòria. Però fins i tot després d'afegir les dues llistes extra de Fanboy, els servidors d'anuncis i rastreig d'hpHosts, l'uBlock encara té un consum de memòria inferior al d'altres bloquejadors coneguts.

Tingueu en compte també que és més probable trobar-se amb llocs web inservibles en seleccionar algunes d'aquestes llistes extra, especialment aquelles llistes que s'utilitzen normalment com a fitxer de hosts.
Tingueu en compte que també és més probable trobar llocs web inservibles en seleccionar algunes d'aquestes llistes extra, especialment aquelles llistes que s'utilitzen normalment com a fitxer de hosts.

***

Expand Down
1 change: 0 additions & 1 deletion dist/description/description-pt_BR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Contribuidores no Crowdin: https://crowdin.net/project/ublock

***

Esta é uma versão ainda em desenvolvimento, tenha isso em mente quando você avaliar.

Registro de alterações do projeto:
https://github.com/gorhill/uBlock/releases
23 changes: 15 additions & 8 deletions dist/firefox/publish-signed-beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@

# We need a version string to work with
if len(sys.argv) >= 2 and sys.argv[1]:
version = sys.argv[1]
tag_version = sys.argv[1]
else:
version = input('Github release version: ')
version.strip()
if not re.search('^\d+\.\d+\.\d+(b|rc)\d+$', version):
tag_version = input('Github release version: ')
tag_version.strip()
match = re.search('^(\d+\.\d+\.\d+)(?:(b|rc)(\d+))?$', tag_version)
if not match:
print('Error: Invalid version string.')
exit(1)
ext_version = match.group(1);
if match.group(2):
revision = int(match.group(3))
if match.group(2) == 'rc':
revision += 100;
ext_version += '.' + str(revision)

# Load/save auth secrets
# The build directory is excluded from git
Expand Down Expand Up @@ -99,7 +106,7 @@ def input_secret(prompt, token):

# https://developer.github.com/v3/repos/releases/#get-a-single-release
print('Downloading release info from GitHub...')
release_info_url = 'https://api.github.com/repos/{0}/{1}/releases/tags/{2}'.format(github_owner, github_repo, version)
release_info_url = 'https://api.github.com/repos/{0}/{1}/releases/tags/{2}'.format(github_owner, github_repo, tag_version)
headers = { 'Authorization': github_auth, }
response = requests.get(release_info_url, headers=headers)
if response.status_code != 200:
Expand Down Expand Up @@ -181,7 +188,7 @@ def input_secret(prompt, token):
headers = { 'Authorization': jwt_auth, }
data = { 'channel': 'unlisted' }
files = { 'upload': f, }
signing_url = 'https://addons.mozilla.org/api/v3/addons/{0}/versions/{1}/'.format(extension_id, version)
signing_url = 'https://addons.mozilla.org/api/v3/addons/{0}/versions/{1}/'.format(extension_id, ext_version)
print('Submitting package to be signed...')
response = requests.put(signing_url, headers=headers, data=data, files=files)
if response.status_code != 202:
Expand Down Expand Up @@ -272,11 +279,11 @@ def input_secret(prompt, token):
updates_json = json.load(f)
f.close()
previous_version = updates_json['addons'][extension_id]['updates'][0]['version']
if LooseVersion(version) > LooseVersion(previous_version):
if LooseVersion(ext_version) > LooseVersion(previous_version):
with open(os.path.join(projdir, 'dist', 'firefox', 'updates.template.json')) as f:
template_json = Template(f.read())
f.close()
updates_json = template_json.substitute(version=version)
updates_json = template_json.substitute(ext_version=ext_version, tag_version=tag_version)
with open(updates_json_filepath, 'w') as f:
f.write(updates_json)
f.close()
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 @@
"[email protected]": {
"updates": [
{
"version": "1.16.5rc1",
"version": "1.16.9.100",
"applications": { "gecko": { "strict_min_version": "52" } },
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.16.5rc1",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.16.5rc1/uBlock0.firefox.signed.xpi"
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.16.9rc0",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.16.9rc0/uBlock0.firefox.signed.xpi"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions dist/firefox/updates.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"[email protected]": {
"updates": [
{
"version": "$version",
"version": "$ext_version",
"applications": { "gecko": { "strict_min_version": "52" } },
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/$version",
"update_link": "https://github.com/gorhill/uBlock/releases/download/$version/uBlock0.firefox.signed.xpi"
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/$tag_version",
"update_link": "https://github.com/gorhill/uBlock/releases/download/$tag_version/uBlock0.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.16.6
1.16.10
72 changes: 41 additions & 31 deletions platform/chromium/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,27 @@ var noopFunc = function(){};

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

vAPI.app = {
name: manifest.name.replace(' dev build', ''),
version: manifest.version
};
vAPI.app = (function() {
// Patch 2018-06-12: This is not needed for Nano
/*
let version = manifest.version;
let match = /(\d+\.\d+\.\d+)(?:\.(\d+))?/.exec(version);
if ( match && match[2] ) {
let v = parseInt(match[2], 10);
version = match[1] + (v < 100 ? 'b' + v : 'rc' + (v - 100));
}
return {
name: manifest.name.replace(/ dev\w+ build/, ''),
version: version
};
*/

return {
name: manifest.name,
version: manifest.version
};
})();

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

Expand Down Expand Up @@ -350,16 +367,7 @@ vAPI.tabs.registerListeners = function() {
}
};

var onBeforeNavigate = function(details) {
if ( details.frameId !== 0 ) {
return;
}
};

var onCommitted = function(details) {
if ( details.frameId !== 0 ) {
return;
}
details.url = sanitizeURL(details.url);
onNavigationClient(details);
};
Expand All @@ -382,7 +390,6 @@ vAPI.tabs.registerListeners = function() {
onUpdatedClient(tabId, changeInfo, tab);
};

chrome.webNavigation.onBeforeNavigate.addListener(onBeforeNavigate);
chrome.webNavigation.onCommitted.addListener(onCommitted);
// Not supported on Firefox WebExtensions yet.
if ( chrome.webNavigation.onCreatedNavigationTarget instanceof Object ) {
Expand Down Expand Up @@ -645,16 +652,16 @@ vAPI.tabs.injectScript = function(tabId, details, callback) {

vAPI.setIcon = (function() {
let browserAction = chrome.browserAction,
titleTemplate = chrome.runtime.getManifest().name + ' ({badge})';

titleTemplate =
chrome.runtime.getManifest().browser_action.default_title +
' ({badge})';

// Patch 2017-12-08: Replace icons
let icons = [
{
tabId: 0,
path: { '128': 'img/128_off.png' }
},
{
tabId: 0,
path: { '128': 'img/128_on.png' }
}
];
Expand All @@ -679,14 +686,15 @@ vAPI.setIcon = (function() {
// Firefox uses an internal cache for each setIcon's paths:
// https://searchfox.org/mozilla-central/rev/5ff2d7683078c96e4b11b8a13674daded935aa44/browser/components/extensions/parent/ext-browserAction.js#631
if ( vAPI.webextFlavor.soup.has('chromium') === false ) { return; }

// TODO 2018-05-15: Due to technical difficulties, disable this for now
return;

let imgs = [
{ i: 0, p: '16' }, { i: 0, p: '32' },
{ i: 1, p: '16' }, { i: 1, p: '32' },
];
let imgs = [];
for ( let i = 0; i < icons.length; i++ ) {
let path = icons[i].path;
for ( let key in path ) {
if ( path.hasOwnProperty(key) === false ) { continue; }
imgs.push({ i: i, p: key });
}
}
let onLoaded = function() {
for ( let img of imgs ) {
if ( img.r.complete === false ) { return; }
Expand All @@ -712,8 +720,11 @@ vAPI.setIcon = (function() {
}
iconData[img.i][img.p] = imgData;
}
icons[0] = { tabId: 0, imageData: iconData[0] };
icons[1] = { tabId: 0, imageData: iconData[1] };
for ( let i = 0; i < iconData.length; i++ ) {
if ( iconData[i] ) {
icons[i] = { imageData: iconData[i] };
}
}
};
for ( let img of imgs ) {
img.r = new Image();
Expand All @@ -727,10 +738,9 @@ vAPI.setIcon = (function() {

if ( browserAction.setIcon !== undefined ) {
if ( parts === undefined || (parts & 0x01) !== 0 ) {
icons[state].tabId = tab.id;
// Patch 2018-05-15: Temporary solution - Chromium handles this
// asynchronously if only path is given
browserAction.setIcon(Object.assign({}, icons[state]));
browserAction.setIcon(
Object.assign({ tabId: tab.id }, icons[state])
);
}
browserAction.setBadgeText({ tabId: tab.id, text: badge });
}
Expand Down
2 changes: 1 addition & 1 deletion platform/webext/manifest.json.old
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"applications": {
"gecko": {
"id": "uBlock0-webext@raymondhill.net",
"id": "[email protected]",
"strict_min_version": "52.0"
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/_locales/bg/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@
"description": "A link for where to get support"
},
"aboutIssues": {
"message": "Проследяване на проблеми",
"message": "Проследяване и докладване на проблеми",
"description": "Text for a link to official issue tracker"
},
"aboutCode": {
Expand Down
4 changes: 2 additions & 2 deletions src/_locales/bn/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"description": "appears as tab name in dashboard"
},
"3pPageName": {
"message": "তৃতীয় পক্ষের ফিল্টারস",
"message": "ছাঁকন তালিকা",
"description": "appears as tab name in dashboard"
},
"1pPageName": {
Expand Down Expand Up @@ -600,7 +600,7 @@
"description": "A link for where to get support"
},
"aboutIssues": {
"message": "Issue tracker",
"message": "ইস্যু অনুসরণকারী",
"description": "Text for a link to official issue tracker"
},
"aboutCode": {
Expand Down
Loading

0 comments on commit 271e5c6

Please sign in to comment.