1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00
Commit Graph

573 Commits

Author SHA1 Message Date
Raymond Hill
02075ab97a
Test for existence of browser.dns
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/780

browser.dns is not available before Firefox 60,
test for presence.
2019-11-19 16:48:53 -05:00
Raymond Hill
3a564c1992
Add ability to uncloak CNAME records
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/780

New webext permission added: `dns`, which purpose is
to allow an extension to fetch the DNS record of
specific hostnames, reference documentation:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/dns

The webext API `dns` is available in Firefox 60+ only.

The new API will enable uBO to "uncloak" the actual
hostname used in network requests. The ability is
currently disabled by default for now -- this is only
a first commit related to the above issue to allow
advanced users to immediately use the new ability.

Four advanced settings have been created to control the
uncloaking of actual hostnames:

cnameAliasList: a space-separated list of hostnames.
Default value: unset => empty list.
Special value: * => all hostnames.
A space-separated list of hostnames => this tells uBO
to "uncloak" the  hostnames in the list will.

cnameIgnoreList: a space-separated list of hostnames.
Default value: unset => empty list.
Special value: * => all hostnames.
A space-separated list of hostnames => this tells uBO
to NOT re-run the network request through uBO's
filtering engine with the CNAME hostname. This is
useful to exclude commonly used actual hostnames
from being re-run through uBO's filtering engine, so
as to avoid pointless overhead.

cnameIgnore1stParty: boolean.
Default value: true.
Whether uBO should ignore to re-run a network request
through the filtering engine when the CNAME hostname
is 1st-party to the alias hostname.

cnameMaxTTL: number of minutes.
Default value: 120.
This tells uBO to clear its CNAME cache after the
specified time. For efficiency purpose, uBO will
cache alias=>CNAME associations for reuse so as
to reduce calls to `browser.dns.resolve`. All the
associations will be cleared after the specified time
to ensure the map does not grow too large and too
ensure uBO uses up to date CNAME information.
2019-11-19 12:05:33 -05:00
Raymond Hill
e2fdc1b94b
Support keyboard shortcut to open popup panel
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/dt47s0/
2019-11-09 09:53:31 -05:00
Raymond Hill
35cb0eb377
Do not bypass network listener in suspended mode
Tabless network requests were bypassing uBO's
onBeforeRequest's listener when in suspended
mode. Suspend mode occurs during the time the
filter lists are all reloaded.

Regression from:
- 1dfdc40e09 (diff-d04c15ee6bff6a6269c6aee25a7c7522R1122)
2019-10-07 08:13:37 -04:00
Raymond Hill
010635acd6
Add support for ping static filter option
Related issue:
- https://github.com/gorhill/uBlock/issues/1493

Documentation:
- https://help.eyeo.com/adblockplus/how-to-write-filters#type-options

Test page:
- https://testpages.adblockplus.org/en/filters/ping

Additionally, network requests of type `beacon` will
be mapped to `ping` by the static filtering engine.
2019-09-22 09:11:55 -04:00
Raymond Hill
4f89a6f89d
Fix missing "Block element" in Firefox's menu
Regression from:
- 58620fb051
2019-09-20 07:51:47 -04:00
Raymond Hill
eec53c0154
Work toward modernizing code base: promisification
Swathes of code have been converted to use
Promises/async/await. More left to do.

Related commits:
- 915687fddb
- 55cc0c6997
- e27328f931
2019-09-16 09:45:17 -04:00
Raymond Hill
1dfdc40e09
Add ability to suspend network request handler at will
This works only for platforms supporting the return of
Promise by network listeners, i.e. only Firefox at this
point.

When filter lists are reloaded[1], there is a small
time window in which some network requests which should
have normally been blocked are not being blocked
because the static network filtering engine may not
have yet loaded all the filters in memory

This is now addressed by suspending the network request
handler when filter lists are reloaded -- again, this
works only on supported platforms.

[1] Examples: when a filter list update session
    completes; when user filters change, when
    adding/removing filter lists.
2019-06-30 10:09:27 -04:00
Raymond Hill
6c34b3c3c9
Use "relax" instead of "toggle"
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/371
2019-06-27 08:16:18 -04:00
Raymond Hill
a9659d039d
Add missing command in manifest.json 2019-06-26 17:17:41 -04:00
Raymond Hill
9dfb570aa8
Use browser_specific_settings instead of applications
As per MDN's documentation, `applications` is a non-standard
alias for `browser_specific_settings` in `manifest.json`:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#Browser_compatibility

Best to use the official manifest key.
2019-05-06 11:34:15 -04:00
Raymond Hill
34a138e3ef
Add unlimitedStorage to Firefox manifest; add timeout to IndexedDB access
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/416

The Chromium version of uBO has declared `unlimitedStorage` since the
extension was first published in 2014. Declaring this permission in
Firefox brings uBO inline with the Chromium version. I suspect some
reported errors could be caused by IndexedDB eviction due to the lack
of `unlimitedStorage` permission.

Additionally, a timeout has been added when uBO tries to access its
indexedDB storage. It's unclear whether this will help with the
mentioned related issue though, the root cause is still to be
identified.
2019-03-17 09:45:28 -04: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
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
ed5d63df69
Grand refactoring of the logger
Performance-related work: the logger data has been decoupled
from the DOM -- inspired from CodeMirror's way of efficiently
handling large amout of text data.

This decoupling now makes the logger highly efficient CPU- and
memory-wise, and open the way to more possibilities.

Ability to configure some aspect of the logger behavior and
visuals:
- The hard-coded limit of 5000 entries has been
  removed and is now replaced with a variety of
  user-configurable settings to enforce the discarding of
  logger entries.
- Some columns in the logger output can now be hidden.

The filter list look-up feature has been merged into the
existing overlay dialog used to create URL rules or static
filters, as an entry in a new "Details" pane.

Other issues addressed during refactoring:
- https://github.com/uBlockOrigin/uBlock-issues/issues/280
- https://github.com/gorhill/uBlock/issues/1999

The minimum version supported on Firefox has been bumped
up to 55.0.
2019-01-12 16:36:20 -05:00
Raymond Hill
0341a5e1f9
Use URL to proper issue in comments 2018-12-25 13:29:41 -05:00
Raymond Hill
be9e7fd11c
Code review related to the early blocking of network requests at launch 2018-12-24 08:56:35 -05:00
Raymond Hill
41548be6be
Move early blocking of requests out of experimental status on Firefox
Related issues:
- https://github.com/gorhill/uBlock/issues/2067
- https://github.com/uBlockOrigin/uBlock-issues/issues/128

Related mozbug issue:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1503721
2018-12-23 17:59:31 -05:00
Raymond Hill
ee89f88265
fix https://github.com/uBlockOrigin/uBlock-issues/issues/345 2018-12-16 10:51:25 -05:00
Raymond Hill
9b27a98f90
Fix https://github.com/gorhill/uBlock/issues/3654
Additionally, there has been refactoring work done regarding
filtering context used throughout uBO, motivated by the fix
here.
2018-12-13 12:30:54 -05:00
Raymond Hill
9039874fc9
refactor some webRequest-related code (now that firefox legacy is out of the way) 2018-10-28 10:58:25 -03:00
Raymond Hill
c5e3773a3c
prevent sidebar from opening when uBO is 1st installed [Firefox] 2018-07-22 16:15:58 -04:00
Raymond Hill
1836f7656e
no need for multiple icon entries when using svg 2018-07-22 10:41:35 -04:00
Raymond Hill
89fd76ac39
use image data instead of paths for browser icons
When using paths, platform implementations of setIcon typically
will fetch the resource then convert to image data internally.
It is preferable for uBO to do this conversion itself as it can
be done only once at launch time.

With chromium-based browsers, using image data eliminate the
incessant network traffic to fetch browser icons as reported
in the extension's dev tool, meaning a good chunk of overhead
is eliminated.

Also, use optimal icon sizes, as of now both chromium and firefox
prefers 16px instead of 19px, and 32px instead of 38px.
2018-05-07 19:03:50 -04:00
Raymond Hill
8be1aed04d
guard against future instances of issue fixed in #3721 2018-05-03 09:55:36 -04:00
Raymond Hill
c9b14e201a
rename "webext" target to more accurate "firefox" 2018-04-27 12:37:33 -04:00
Raymond Hill
443010efdc
remove firefox/legacy platform, it now has its own branch: firefox-legacy 2018-04-27 08:40:53 -04:00
anvakl
4d3a2b5f85 Minor fixes to code (#3720)
* Fix leftovers from old code.

* change changes.procedural.size to changes.procedural.length

changes.procedural is an array so it should be changes.procedural.length
the  code works with changes.procedural.size because (undefined !== 0) is always true.
2018-04-24 06:05:30 -04:00
Raymond Hill
b42c128213
increase min version of Pale Moon 2018-03-12 09:02:51 -04:00
Raymond Hill
2c901588c7
fix #3546, #3428 2018-02-26 13:59:16 -05:00
gorhill
806032cdc4
improve DOM inspector
- Fix regressions reported in #3159
- Fix #2001
- Fix some item points in #407
2017-11-20 08:42:32 -05:00
gorhill
9c23e4ab67
adjust minimum version to account for usage of Array.from 2017-11-14 08:44:59 -05:00
gorhill
23487a643a
prepend vapi-usercss.js to contentscript.js in extension package 2017-10-24 12:40:58 -04:00
gorhill
6112a68faf
fix #2984 2017-10-21 13:43:46 -04:00
gorhill
fdcc9515dc
fix #2029 2017-08-17 08:25:02 -04:00
gorhill
d2af82bdbf
set proper min-max versions for Firefox 2017-08-13 08:25:07 -04:00
gorhill
0e078e536d
eliminate validation warning on AMO: avoid innerHTML 2017-08-11 14:26:15 -04:00
gorhill
faca2718fa
set FF56 as max version compatible with legacy version of uBO 2017-08-08 10:56:53 -04:00
gorhill
47dfb1b22c
fix https://github.com/uBlockOrigin/uAssets/issues/567 2017-07-22 16:57:29 -04:00
gorhill
432818df4f
fix popup panel width issue when photon disabled [firefox] 2017-07-03 12:25:13 -04:00
gorhill
88cafba445
[firefox] create key elements even if no shortcut assigned 2017-07-02 08:41:21 -04:00
gorhill
0564040f3a
code review: skip keyboard shortcuts code for thunderbird, fennec 2017-06-22 18:11:20 -04:00
gorhill
ca45ade4c5
fix #2723 2017-06-22 14:34:18 -04:00
gorhill
d944a59b10
fix #2709 2017-06-17 10:17:13 -04:00
gorhill
e611879c30
fix #2696 2017-06-10 17:33:20 -04:00
gorhill
9a9a8c8c3f
Firefox platform: longer default wait time for deferred tasks 2017-05-30 09:16:44 -04:00
gorhill
a72769f8ba
Firefox platform: minor code review; defer non-critical tasks to later at launch 2017-05-30 09:09:24 -04:00
gorhill
ffc8057dc6
complete fix for #113 2017-05-29 14:56:17 -04:00
gorhill
ce0761248a
remove now obsolete code, as per #2612 2017-05-16 08:12:44 -04:00
gorhill
139d97179f
as per #2612, use native Set() in content scripts 2017-05-15 08:51:25 -04:00
gorhill
5c9ffd9af5
fix #2558 2017-04-24 18:30:06 -04:00
gorhill
b3d210c866
minor code review 2017-04-03 10:10:27 -04:00
gorhill
209f79535b
new revision for release candidate 2017-04-02 22:48:11 -04:00
gorhill
43e6a7599d
fix #2506 2017-04-02 16:23:13 -04:00
gorhill
f6563be542
fix #2506 2017-04-02 13:29:08 -04:00
gorhill
c0b0afadec
minor code review + new revision for release candidate 2017-04-01 19:11:58 -04:00
Gijs
53a794d9b2 Fix #2502 by waiting for the hidden window even when not using it for the background page (#2503) 2017-04-01 17:56:50 -04:00
gorhill
5699e85afa
fix https://github.com/gorhill/uBlock/issues/2502#issuecomment-290943606 2017-04-01 16:22:34 -04:00
gorhill
9f4a879bca
fix https://github.com/gorhill/uBlock/issues/2502#issuecomment-290939436 2017-04-01 15:45:24 -04:00
gorhill
08409c5cb3
fix regression bug introduced with 0112e5 2017-04-01 12:14:44 -04:00
gorhill
66635c44c6
fix warning on older firefox versions 2017-04-01 12:13:29 -04:00
gorhill
b9e4a00c7a
Merge branch 'fix-hiddenwindow-usage' of https://github.com/gijsk/uBlock 2017-04-01 11:01:11 -04:00
gorhill
8e73fb32b5
fix https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6#c10 2017-04-01 10:00:09 -04:00
gorhill
0112e54834
fix https://bugs.chromium.org/p/project-zero/issues/detail?id=1225&desc=6#c10 2017-04-01 09:41:08 -04:00
Gijs Kruitbosch
dc06d5fa0c Fix #2493 by using the createWindowlessBrowser API when available 2017-03-31 21:17:21 +01:00
Andrei Petcu
e8375f91cd #2433 Changed the XML namespaces to please jpm sign (#2434)
*  #2433 changed the legacy install.rdf to match MDN
https://developer.mozilla.org/en-US/Add-ons/Install_Manifests

*  #2433 changed webext install.rdf to match MDN docs
 https://developer.mozilla.org/en-US/Add-ons/Install_Manifests

*  #2433 changed property added by mistake

*  #2433 changed localization XML namespaces to match install.rdf

*  #2433 small fixes
2017-03-10 07:01:57 -05:00
gorhill
1d705485e9 update max version info 2017-02-06 15:36:34 -05:00
gorhill
1809636680 fix #2337 2017-01-25 08:05:41 -05:00
gorhill
b21e765f5c minor code review 2017-01-09 09:16:37 -05:00
gorhill
3b0d3e3330 code review: saner way to find a popup's opener tab id 2017-01-08 17:52:38 -05:00
gorhill
a303c7800e fix #2290 2017-01-08 14:36:08 -05:00
gorhill
4e747fd39e minor code review 2017-01-07 10:58:25 -05:00
gorhill
1a92fff641 fix https://github.com/uBlockOrigin/uAssets/issues/255 2017-01-02 10:50:03 -05:00
gorhill
e09b702470 fix #2274 (hopefully) 2016-12-28 23:39:15 -05:00
gorhill
2f01fcda54 fix #2256 2016-12-21 11:44:03 -05:00
gorhill
94637ee4ff fix https://github.com/nikrolls/uBlock-Edge/issues/30 2016-12-15 10:47:32 -05:00
gorhill
4a4de32bba fix #2226 2016-12-07 23:59:10 -05:00
gorhill
73c8a96c48 workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1317173 2016-11-16 16:08:03 -05:00
Sean Whitton
8f39f88366 drop Conkeror from install.rdf (#2131)
Since #1356 has been declined.
2016-11-06 18:00:36 -05:00
gorhill
f2cb4cefc4 fix #2126 2016-11-04 12:59:06 -04:00
gorhill
8c3da95d65 fix #2067 (experimental) + support for hidden settings 2016-11-03 11:20:47 -04:00
gorhill
3628de7a9d necessary changes for https://github.com/nikrolls/uBlock-Edge/pull/22 2016-10-28 08:40:38 -04:00
gorhill
cbefeb923c fix #1884 2016-10-14 10:06:34 -04:00
gorhill
cd81f866b9 code review: benefit from ES6 Set() in content script
fall back on legacy browser-specific polyfill code if required.
2016-10-09 11:09:25 -04:00
gorhill
a1fa4d0fe9 fix #2060 2016-10-08 15:14:24 -04:00
gorhill
c084853d9a fix #1772: ability to preview procedural cosmetic filters 2016-10-01 12:34:25 -04:00
gorhill
d721b83e21 code review #2014: gracefully deal with importing from a pre-1.9.12 module 2016-09-28 08:43:40 -04:00
gorhill
56176c8eb7 fix #2030: brain fart bug 2016-09-26 00:07:29 -04:00
gorhill
69a76109c8 code review re 029bc946ad
- fix error message when disabling extension
- properly cleanup when disabling extension
2016-09-25 16:02:11 -04:00
gorhill
029bc946ad oops, forgot to git add this for #2014 2016-09-24 15:28:33 -04:00
gorhill
95ec573141 fix #2014 2016-09-24 14:36:08 -04:00
gorhill
a7fe367eec refactor where appropriate to make use of ES6 Set/Map (#1070)
At the same time, the following issues were fixed:
- #1954: automatically lookup site-specific scriptlets
- https://github.com/uBlockOrigin/uAssets/issues/23
2016-09-12 10:22:25 -04:00
gorhill
aa20b6185d typo in comments 2016-09-12 08:14:09 -04:00
gorhill
921bdfeba7 minor changes: header stuff 2016-09-10 08:29:18 -04:00
gorhill
2c925ff5ee fix https://github.com/uBlockOrigin/uAssets/issues/123#issuecomment-244033330 2016-09-01 08:29:24 -04:00
gorhill
33234fdd8b fix #1952 2016-08-31 17:50:49 -04:00
buttercookie42
3ea58979d5 Support back button navigation on Android (#1917)
When opening a new tab in Fennec, we should pass the ID of the current tab as parentId, so that pressing the back button afterwards closes the new tab and returns to the original tab instead of just closing Firefox.
2016-08-20 07:52:16 -04:00
gorhill
07d15ae817 minor code review 2016-08-16 08:42:12 -04:00
gorhill
2725479709 better fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1232354, as pointed out in comments 2016-08-15 22:50:24 -04:00
gorhill
fb7bd0cc1d fix #1893 2016-08-13 21:45:01 -04:00