Commit Graph

587 Commits

Author SHA1 Message Date
Raymond Hill 221983646e
Injects user styles and content scripts in `about:blank` frames
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/688
- https://github.com/uBlockOrigin/uBlock-issues/issues/1164

`match_about_blank` is now used for content scripts and
user styles.
2020-07-19 09:06:19 -04:00
Raymond Hill eeae4b2cab
Add ability to open the dashboard with a keyboard shortcut
Related feedback:
- https://github.com/gorhill/uBlock/commit/9a6feb34d546#commitcomment-38852663
2020-04-30 10:31:23 -04:00
Raymond Hill b295d4a0d0
Make the new "fenix" popup panel the default one
The old "classic" popup panel will still be used
when at least one of the following is true:

- advanced setting `uiFlavor` is set to `classic`; or
- the browser is Chromium 65 or older; or
- the browser is Firefox 67 or older

The default configuration of the new popup panel
at installation time is to show the power button,
statistics and the basic tool icons, i.e. access
to dashboard, logger, pickers.

For existing installations, the new popup panel
will be configured by respecting the existing
configuration of the classic one.

The new popup panel is currently already in use
on Firefox for Android, and the visual redesign
was made according to suggestions and feedback
from <https://github.com/brampitoyo> to be
optimal for Firefox for Android.

The new popup panel will allow closing the following
pending issues:

- https://github.com/uBlockOrigin/uBlock-issues/issues/255
- https://github.com/uBlockOrigin/uBlock-issues/issues/178
2020-04-30 06:54:51 -04:00
Raymond Hill 11d24abea0
Move proxy-detection code to Firefox-specific code
Related commit:
- https://github.com/uBlockOrigin/uBlock-issues/issues/911

The motivation is to avoid executing code which is
unnecessary on platforms not supporting the browser.dns
API.
2020-03-23 13:31:43 -04:00
Raymond Hill 3f7ece9469
Do not cname-uncloak when a proxy is in use
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/911

Since cname-uncloaking is available only on Firefox
at the moment, the fix is relevant only to Firefox.

By default uBO will no longer cname-uncloak when it
detects that network requests are being being proxied.

This default behavior can be overriden by setting the
new advanced setting `cnameUncloakProxied` to `true`.
The new setting default to `false`, i.e. cname-uncloaking
is disabled when uBO detects that a proxy is in use.

This new advanced setting may disappear once the
following Firefox issue is fixed:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1618271
2020-03-22 14:52:58 -04:00
Raymond Hill 1400b146ec
Add 32- & 64-pixel icon entries in manifest
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/939
2020-03-14 13:05:46 -04:00
Raymond Hill bc6e585b5d
Rephrase `author` entry in manifest 2020-01-30 12:46:54 -05:00
Raymond Hill d0738c0835
Visually distinguish canonical names in popup panel
Further fine-tuning support for canonical names.

Aliased canonical names will be rendered blue
in the dynamic filtering pane of the popup panel.
2019-12-31 16:36:51 -05:00
Raymond Hill 832ebd360e
Mind that Firefox 59 and less does not support `browser.dns` 2019-12-08 11:08:04 -05:00
Raymond Hill d71f69bd90
Minor code review 2019-12-05 09:21:02 -05:00
Raymond Hill 91e702cebb
Enable CNAME uncloaking by default
Advanced setting `cnameAliasList` has been removed.

New advanced settings:

cnameUncloak:
  Boolean
Default value:
  true
Description:
  Whether to CNAME-uncloak hostnames.

cnameIgnoreExceptions:
  Boolean
Default value:
  true
Description:
  Whether to bypass the uncloaking of network requests
  which were excepted by filters/rules. This is
  necessary so as to avoid undue breakage by having
  exception filters being rendered useless as a result
  of CNAME-uncloaking.
  For example, `google-analytics.com` uncloaks to
  `www-google-analytics.l.google.com` and both hostnames
  appear in Peter Lowe's list, which means exception
  filters for `google-analytics.com` (to fix site
  breakage) would be rendered useless as the uncloaking
  would cause the network request to be ultimately
  blocked.
2019-12-01 12:05:49 -05:00
Raymond Hill a16e4161de
Fine tune hostname uncloaking through CNAME-lookup
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/780

Related commit:
- https://github.com/gorhill/uBlock/commit/3a564c199260

This adds two new advanced settings:

- cnameIgnoreRootDocument
  - Default to `true`
  - Tells uBO to skip CNAME-lookup for root document.

- cnameReplayFullURL
  - Default to `false`
  - Tells uBO whether to replay the whole URL or just
    the origin part of it.
    Replaying only the origin part is meant to lower
    undue breakage and improve performance by avoiding
    repeating the pattern-matching of the whole URL --
    which pattern-matching was most likely already
    accomplished with the original request.

This commit is meant to explore enabling CNAME-lookup
by default for the next stable release while:

- Eliminating a development burden by removing the
  need to create a new filtering syntax to deal with
  undesirable CNAME-cloaked hostnames

- Eliminating a filter list maintainer burden by
  removing the need to find/deal with all base
  domains which engage in undesirable CNAME-cloaked
  hostnames

The hope is that the approach implemented in this
commit should require at most a few unbreak rules
with no further need for special filtering syntax
or filter list maintance efforts.
2019-11-23 13:07:23 -05:00
Raymond Hill 3463a60e6b
Fix incorrect resolved value in promise
This fixes the ability to block when a hostname
had to be cname-resolved the first time it was
encountered. The result being cached allowed
the subsequent requests to be correctly blockable.
2019-11-21 12:04:19 -05:00
Raymond Hill 563aed0d93
Code review for dns lookup code
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/780

- Handle DNS lookup failure

- Skip DNS lookup for non network-based URLs

- Benchmark code to be able to provide an estimate
  based on objective measurements regarding added
  overhead when DNS lookup is enabled
  (quick answer: a complete non-issue)
2019-11-20 10:45:17 -05:00
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