Commit Graph

6354 Commits

Author SHA1 Message Date
Raymond Hill 363d97fb22
New revision for dev build 2019-02-17 16:05:43 -05:00
Raymond Hill 0d369cda21
Allow use of browser.storage.local as cache storage backend in Firefox
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/409

By default `indexedDB` is used in Firefox for purpose of cache storage
backend.

This commit allows to force the use of `browser.storage.local` instead
as cache storage backend. For this to happen, set `cacheStorageAPI` to
`browser.storage.local` in advanced settings.

Additionally, should `indexedDB` not be available for whatever reason,
uBO will automatically fallback to `browser.storage.local`.
2019-02-17 15:40:09 -05:00
Raymond Hill 3b81841dc0
Properly set resource URL in benchmark loop 2019-02-17 07:45:05 -05:00
Raymond Hill 553ba2c7ed
Make Firefox dev build auto-update 2019-02-16 19:49:31 -05:00
Raymond Hill 5558146649
New revision for dev build 2019-02-16 19:32:05 -05:00
Raymond Hill d63592b11e
Remove obsolete code to translate `|blob:` filters into CSP filters
These filters are to be considered obsolete since they can't be
matched against network requests in the webRequest API.

They were probably meant to work when ABP was pre-webext, which
means they are quite probably obsolete and there is no longer
a point for uBO to conveniently translate them into CSP directives.
2019-02-16 19:25:15 -05:00
Raymond Hill e93062bcdf
Spin-off FilterOrigin flavors into standalone classes
This removes the derivation of FilterOrigin flavors from
FilterOrigin itself and simplify code paths. FilterOrigin
flavors are small specialized classes, no need to
overcomplicate with derivation.

Specifically, this removes an indirect call to reach the
match() method.
2019-02-16 12:16:30 -05:00
Raymond Hill 5733439f62
Leverage whotracks.me's huge dataset of URLs for benchmark purpose
As seen at:
  https://whotracks.me/blog/adblockers_performance_study.html

The requests.json.gz file can be downloaded from:
  https://cdn.cliqz.com/adblocking/requests_top500.json.gz

Copy the file into ./tmp/requests.json.gz

If the file is present when you build uBO using `make-[target].sh` from
the shell, the resulting package will contain `./assets/requests.json`,
which will be looked-up by the method below to launch a benchmark
session.

From uBO's dev console, launch the benchmark:
  µBlock.staticNetFilteringEngine.benchmark();

The usual browser dev tools can be used to obtain useful profiling
data, i.e. start the profiler, call the benchmark method from the
console, then stop the profiler when it completes.

Keep in mind that the measurements at the blog post above where obtained
with ONLY EasyList. The CPU reportedly used was:
  https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i7-6600U+%40+2.60GHz&id=2608

Rename ./tmp/requests.json.gz to something else if you no longer want
./assets/requests.json in the build.
2019-02-15 16:18:03 -05:00
Raymond Hill e589e280c1
Make Firefox dev build auto-update 2019-02-15 08:02:58 -05:00
Raymond Hill 797c2ccecc
New revision for dev build 2019-02-15 07:54:18 -05:00
Raymond Hill b1f7739cba
Import translation work from https://crowdin.com/project/ublock 2019-02-15 07:50:28 -05:00
Raymond Hill 515b7cdcfc
Use proper embedding context when evluating `inline-script`
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/422
2019-02-15 07:37:43 -05:00
Raymond Hill acda682153
Make Firefox dev build auto-update 2019-02-14 16:53:57 -05:00
Raymond Hill b07edb2429
New revision for dev build 2019-02-14 16:49:58 -05:00
Raymond Hill ed7e34fb07
Refactor selfie generation into a more flexible persistence mechanism
The motivation is to address the higher peak memory usage at launch
time with 3rd-gen HNTrie when a selfie was present.

The selfie generation prior to this change was to collect all
filtering data into a single data structure, and then to serialize
that whole structure at once into storage (using JSON.stringify).

However, HNTrie serialization requires that a large UintArray32 be
converted into a plain JS array, which itslef would be indirectly
converted into a JSON string. This was the main reason why peak
memory usage would be higher at launch from selfie, since the JSON
string would need to be wholly unserialized into JS objects, which
themselves would need to be converted into more specialized data
structures (like that Uint32Array one).

The solution to lower peak memory usage at launch is to refactor
selfie generation to allow a more piecemeal approach: each filtering
component is given the ability to serialize itself rather than to be
forced to be embedded in the master selfie. With this approach, the
HNTrie buffer can now serialize to its own storage by converting the
buffer data directly into a string which can be directly sent to
storage. This avoiding expensive intermediate steps such as
converting into a JS array and then to a JSON string.

As part of the refactoring, there was also opportunistic code
upgrade to ES6 and Promise (eventually all of uBO's code will be
proper ES6).

Additionally, the polyfill to bring getBytesInUse() to Firefox has
been revisited to replace the rather expensive previous
implementation with an implementation with virtually no overhead.
2019-02-14 13:33:55 -05:00
Raymond Hill 83a3767a16
Test presence of `firefox` instead of absence of `chromium` 2019-02-12 15:29:20 -05:00
Raymond Hill 2fb4dc8358
Update PSL library to latest official version 2019-02-12 12:00:20 -05:00
Raymond Hill 8c4249a870
Try to not rely on UA to lookup environment flavor
The environment flavor is used to by uBO to for self-configuration.

For users with spoofed UA at the `about:config` level, this might
cause uBO to misconfigure itself. Avoid UA and strictly rely on
browserInfo() for looking up environment parameters.
2019-02-12 11:11:58 -05:00
Raymond Hill e4f3559db1
Remove JPN-0 from stock lists
As per feedback, for example:
- https://www.reddit.com/r/uBlockOrigin/comments/apby98/
2019-02-12 10:23:48 -05:00
Raymond Hill 1e2969c3b0
Update PSL library to last version 2019-02-12 07:59:38 -05:00
Raymond Hill e06cf1de9b
Shield early request handler against re-entrance
Unlikely re-entrance is occurring, but there is no harm
shielding against it -- just in case.
2019-02-12 07:13:37 -05:00
Raymond Hill 0011040cbe
Make Firefox dev build auto-update 2019-02-10 12:31:18 -05:00
Raymond Hill 0c976992ba
Import translation work from https://crowdin.com/project/ublock 2019-02-10 12:26:48 -05:00
Raymond Hill 1eb3250bb2
New revision for dev build 2019-02-10 12:24:55 -05:00
Raymond Hill 4da340384a
Update publicSuffixLibrary to latest (WASM-able) version
See https://github.com/gorhill/publicsuffixlist.js
2019-02-10 12:19:05 -05:00
Raymond Hill 00236cf54f
Use `esversion` instead of deprecated `esnext` 2019-02-08 09:45:25 -05:00
Raymond Hill 29b10d2151
Tone down logger visual for tab-less network requests 2019-02-05 12:05:00 -05:00
Raymond Hill 74823f6120
New revision for stable release 2019-02-05 07:06:30 -05:00
Raymond Hill d432f78b66
Import translation work from https://crowdin.com/project/ublock 2019-02-05 07:04:52 -05:00
Raymond Hill 3977f8382c
Make Firefox dev build auto-update 2019-02-02 08:24:10 -05:00
Raymond Hill d8a34dfbb4
New revision for release candidate 2019-02-02 08:18:13 -05:00
Raymond Hill 4c428edeef
Import translation work from https://crowdin.com/project/ublock 2019-02-02 08:14:47 -05:00
Raymond Hill 656203adc7
Minor generic code review of changes since 1.18.2 2019-02-02 08:09:34 -05:00
Raymond Hill 54eb608bc3
Make Firefox dev build auto-update 2019-02-01 09:16:36 -05:00
Raymond Hill e9b65259a9
New revision for release candidate 2019-02-01 09:12:55 -05:00
Raymond Hill fc03782985
Ensure that WASM module was actually loaded 2019-02-01 09:09:51 -05:00
Raymond Hill 81e4cb81e3
Make Firefox dev build auto-update 2019-02-01 08:40:44 -05:00
Raymond Hill 30bd6c53e4
New revision for release candidate 2019-02-01 08:37:24 -05:00
Raymond Hill ff269d793d
Use `indexedDB` instead of for cacheStorageAPI value 2019-02-01 08:27:28 -05:00
Raymond Hill 69c87c5117
Fix Promise chain of WASM module load operations
The Promise chain was not properly designed for WASM module
loading. This became apparent when removing WASM modules
from Opera build[1].

The problem was that errors thrown by fetch() -- used to
load WASM modules -- were not properly handled.

[1] Opera refuses updating uBO if there are unrecognized file
types in the package, and `.wasm`/`.wat` files are not
recognized by Opera uploader.
2019-02-01 08:20:43 -05:00
Raymond Hill 4f3aed6fe6
Manually fix updates.json to ensure dev build auto-update
The script failed to upload the signed package (error 502 from GitHub),
hence updates.json was not auto-updated as a consequence.
2019-01-29 12:50:36 -05:00
Raymond Hill 40601bd533
New revision for dev build 2019-01-29 12:14:50 -05:00
Raymond Hill 923c5ce5bd
Compute URL of sublists as relative to URL of parent list
Related issue:
- https://github.com/NanoAdblocker/NanoCore/issues/239

The erroneous behavior was to compute the URL of a sublist as
relative to the URL of the root list, which may differ from the
URL of a parent list.
2019-01-29 11:52:16 -05:00
Raymond Hill 3195f554f7
Fix partyness evaluation for cases of base domain-less hostnames
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/402
2019-01-29 10:34:58 -05:00
Raymond Hill f8b6d96ffd
Make Firefox dev build auto-update 2019-01-28 16:26:58 -05:00
Raymond Hill 98307e07cb
Import translation work from https://crowdin.com/project/ublock 2019-01-28 16:22:41 -05:00
Raymond Hill 5695443d01
New revision for dev build 2019-01-28 16:20:39 -05:00
Raymond Hill 920eee88be
Code review: ensure vAPI.shutdown.exec is called from root context only
This prevents uncaught errors in content scripts when uBO's main
process is terminated (i.e. disabled, updated).
2019-01-28 16:16:52 -05:00
Raymond Hill a6ebcc85be
Reuse both flavors of webRequest wrapper in webext package
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/407

Both flavors will be stitched together into a single
`vapi-qebrequest.js` file.

The decision of which flavor to use will be made at runtime,
according to the browser environment.
2019-01-28 16:12:26 -05:00
Raymond Hill d2335b9fbd
Make Firefox dev build auto-update 2019-01-27 17:31:40 -05:00