1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00
Commit Graph

229 Commits

Author SHA1 Message Date
Raymond Hill
066440534d
Prevent popup panel to close when forcing a tab reload
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/672

Additionally, this commit add the ability to press F5 to
force a reload while the popup panel is opened.
2019-07-21 11:50:15 -04:00
Raymond Hill
e1dd7f7043
Ensure toolbar icon reflect updated whitelist directives
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/680

Opportunistically, vAPI.tabs has been refactored toward
ES6 syntax.
2019-07-21 10:48:44 -04:00
Raymond Hill
730a83377e
Minor code review re. context menu code
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/151

I have been unsuccessful fixing the above issue, but I will
keep the changes made in the process of trying to fix it.
2019-07-02 09:43:26 -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
693687fd74
Add keyboard support for toggling down blocking profile
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/371

By default, no specific keyboard shortcut is predefined,
this will have to be assigned by the user. The command
name in English is "Toggle blocking profile".

The default behavior is to toggle down according to one
of the following scenarios.

a) If script execution is disabled through the no-scripting
switch, the no-scripting switch will be locally toggled
so as to allow script execution. The page will be
automatically reloaded.

b) If script execution is not blocked but the 3rd-party
script and/or frame cells are blocked, local no-op rules
will be set so as to no longer block 3rd-party scripts
and/or frames. The page will be automatically reloaded.

Given this, it may take more than one toggle down command
to reach the lowest blocking profile, which is one where
JavaScript execution is not blocked and 3rd-party scripts
and frames resources block rules, if any, are bypassed
with local no-op rules.

TODO: At this point, I haven't yet decided whether
toggling from the lowest profile should restore the
original highest blocking profile.
2019-06-26 07:47:14 -04:00
Raymond Hill
184e4f7a42
Avoid reloading the dashboard tab if it is already present
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/592
2019-05-24 20:15:40 -04:00
Raymond Hill
eed13194fb
Handle possible exceptions in vAPI.messaging.broadcast()
I had exceptions thrown by that code once in a while,
about the `port` object not being connected; possibly
occurs only when using dev tools with breakpoints
in uBO's code. Even if this can be reproduced randomly
only when debugging uBO, it costs nothing to add code
in there to handle exceptions.
2019-05-21 14:07:38 -04:00
Raymond Hill
b87b242384
Use per-request secret rather than time-based secret
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/550
2019-05-01 07:41:04 -04:00
Raymond Hill
99212e3264
Code review: use function arrow properly 2019-05-01 06:35:47 -04:00
Raymond Hill
016625465e
Simplify a bit 9e43852 by using Array.every() 2019-04-30 16:18:40 -04:00
Raymond Hill
0714aceaaf
Simplify secret generation introduced in 9e4385243c 2019-04-30 15:19:10 -04:00
Raymond Hill
9e4385243c
Web accessible secrets can be used for at most one second
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/550

Related Chromium issue (I can't access it):
- https://bugs.chromium.org/p/chromium/issues/detail?id=957866

Findings so far: affects browsers based on Chromium 74.
I could not reproduce the issue with either Chromium 73 or
Google Chrome 75.

This commit is a mitigation: to prevent sites from using
uBO's internal WAR secret for tracking purpose. A secret
can be used for at most one second, after which a new secret
is generated.

The original issue related to the implementation of
secret-gated web accessible resources is:
- https://github.com/gorhill/uBlock/issues/2823
2019-04-30 14:36:07 -04:00
Raymond Hill
367cdd6666
Make use of X-DNS-Prefetch-Control in Chromium-based browsers
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/548

The fix applies only to Chromium-based browsers -- a
`X-DNS-Prefetch-Control` header[1] will be unconditionally
injected when uBO's "Disable pre-fetching" setting is
enabled (it is by default).

This is a mitigation, this does not completely fix the issue
of the setting "Disable pre-fetching" being disregarded on
Chromium-based browsers when sites use
`preconnect`/`preload`.

[1] https://developer.mozilla.org/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
2019-04-27 13:12:33 -04:00
Raymond Hill
977178bef2
Use a lower WebRTC mode on Firefox to hide private IP addresses
Releated issue:
- https://github.com/gorhill/uBlock/issues/3009

Firefox implements differently the behavior of `disable_non_proxied_udp`,
and this probably leads to more oft-misdiagnosed breakage.

Example:
https://www.reddit.com/r/firefox/comments/b4guyl/gotowebmeeting_same_unsupported_bs/
2019-03-23 16:23:42 -03: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
5b7a3c9983
fix https://github.com/uBlockOrigin/uBlock-issues/issues/256; add regex support in logger filter field 2018-12-14 11:01:21 -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
649f82f901
fix https://github.com/uBlockOrigin/uBlock-issues/issues/296 2018-11-02 08:55:15 -03: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
c00297680b
fix https://www.reddit.com/r/uMatrix/comments/8lc9ia/ 2018-08-25 12:57:21 -04:00
Raymond Hill
273f1db297
fix <https://github.com/uBlockOrigin/uBlock-issues/issues/168>: Firefox for Android does not support the windows API 2018-08-14 18:56:08 -04:00
Raymond Hill
06756baed9
improve use of imageData in setIcon
- Generate imageData according to existing path information
- Pass a copy as argument (see 06768dcadb)
2018-05-27 11:13:25 -04:00
Raymond Hill
3b61ef51b0
fix version parsing in 91b0ac5b3f 2018-05-20 08:12:09 -04:00
Raymond Hill
91b0ac5b3f
fix dd92337a4a (commitcomment-29051501) 2018-05-20 07:45:39 -04:00
Raymond Hill
c5d8588118
inject scriptlets earlier (experimental) (ex. https://github.com/uBlockOrigin/uAssets/issues/2300) 2018-05-17 07:33:21 -04:00
Raymond Hill
a9a1cc3f3b
code review: use setIcon w/ ImageData only for chromium-based browsers 2018-05-09 08:08:19 -04:00
Raymond Hill
d3691cf45a
fix https://github.com/uBlockOrigin/uBlock-issues/issues/32 2018-05-08 15:01:25 -04:00
Raymond Hill
7e5661383a
code review to further lower overhead of updating toolbar icon 2018-05-08 09:43:25 -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
14709d18cf
fix #2809 2018-05-04 08:44:54 -04:00
Raymond Hill
50d5ab68c8
fix https://github.com/uBlockOrigin/uBlock-issues/issues/9 2018-04-22 14:50:40 -04:00
Raymond Hill
5386558e68
fix https://www.reddit.com/r/uBlockOrigin/comments/8dkvqn/116_broken_loading_custom_filters_from_my_filters/ 2018-04-21 12:34:54 -04:00
Raymond Hill
e40a66e294
code review of efcab14597: fix collected errors; replace Promises with callbacks 2018-04-12 17:32:38 -04:00
Raymond Hill
efcab14597
Squashed commit of the following:
commit ab2b328cf1360a751fa1c58b8521f907eeb1ec50
Author: Raymond Hill <rhill@raymondhill.net>
Date:   Thu Apr 12 12:08:30 2018 -0400

    fix #3588

commit c4ae7638dfa5a5c7ddec2f9dd2d2988450082542
Author: Raymond Hill <rhill@raymondhill.net>
Date:   Thu Apr 12 09:08:56 2018 -0400

    detect user stylesheets support from content scripts (#3588)
2018-04-12 12:17:38 -04:00
Raymond Hill
79b4706746
code review: avoid special WebRTC test for non-Chromium browsers (#533) 2018-04-06 13:25:06 -04:00
Raymond Hill
93f49a61d7
add pre-processor directives to filter list compiler (https://github.com/AdguardTeam/AdguardBrowserExtension/issues/917) 2018-04-05 07:29:15 -04:00
Raymond Hill
bf384e2bca
better evaluate vAPI.webextFlavor 2018-04-04 12:42:01 -04:00
Raymond Hill
2c901588c7
fix #3546, #3428 2018-02-26 13:59:16 -05:00
Raymond Hill
17930cc778
fix #3474, #2823 2018-02-15 17:25:38 -05:00
Raymond Hill
36b1eac88e
fix #3425 (regression from 6cdb20df) 2018-01-10 17:59:07 -05:00
Raymond Hill
6cdb20dffe
improve logger convenience following fix for #2854 2018-01-09 08:08:17 -05:00
Raymond Hill
689d18c54f
fix #2854 2018-01-08 14:29:39 -05:00
Raymond Hill
b7155a0e0f
fix #3408 2018-01-07 17:53:33 -05:00
Kacper Michajłow
ec70c75264 improve DOM inspector (#3254)
* dom-inspector: Improvments

- Fix race between userCSS injection and element highlight resulting in none or not all elements highlighted.
- Fix page being scanned twice resulting in unneeded slowdown.

* dom-inspector: Clear mutationTimer to allow more than one update.

* dom-inspector: Fix procedural filters shown as declarative with expando.
2017-11-21 18:08:32 -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
387eaa0b21
fix #3185 2017-11-16 10:55:28 -05:00
gorhill
bbda2a9086
code review: preemptively address https://bugzilla.mozilla.org/show_bug.cgi?id=1408996#c9 2017-10-27 14:22:45 -04:00
gorhill
2d5e3f38f3
code review: use Map instead of Object 2017-10-25 11:27:16 -04:00
gorhill
6e18829f02
add to #2984: fix regressions, as per feedback and code review 2017-10-23 09:01:00 -04:00
gorhill
ef84e6d8fd
fix https://github.com/gorhill/uBlock/issues/2984#issuecomment-338475886 2017-10-22 12:48:13 -04:00
gorhill
6112a68faf
fix #2984 2017-10-21 13:43:46 -04:00
gorhill
a19efa4ebe
fix #3082 (use "dev build" in extension name) 2017-10-01 10:28:33 -04:00
gorhill
b3e4caa59f
code review of #3073 2017-09-30 08:07:10 -04:00
gorhill
526ffe214d
fix #3073 2017-09-30 07:56:35 -04:00
gorhill
4865561ca4
code review re. #3006 2017-09-29 08:49:22 -04:00
gorhill
a4e61b51cd
further fix #3006: see https://github.com/gorhill/uBlock/issues/3006#issuecomment-332597677 2017-09-27 15:29:57 -04:00
gorhill
f10fb29714
fine tune fix #3006 2017-09-27 08:42:27 -04:00
gorhill
c74526a895
fix #3057 2017-09-26 16:09:35 -04:00
gorhill
b1f04c79b0
code review: cleaner user-stylesheets support as proposed in https://issues.adblockplus.org/ticket/5695 2017-09-16 10:55:28 -04:00
gorhill
0d18d996be
fix #3006 2017-09-11 17:02:44 -04:00
gorhill
1a3df881d0
code review: handle tab gone + decrease user css overhead 2017-09-05 19:51:16 -04:00
gorhill
867eeebc19
fix #2957 2017-09-02 18:27:03 -04:00
gorhill
a0c595d02d
fix #2950 2017-09-02 06:11:33 -04:00
gorhill
6fb6b4ed98
fix #2824: use dummy localStorage if none available 2017-07-26 08:11:22 -04:00
gorhill
645c862886
always set browserAction title 2017-07-25 09:16:48 -04:00
gorhill
906cb34716
make uBO/webext functional on Firefox for Android Nightly 2017-07-24 19:25:49 -04:00
gorhill
d866e4d472
add proper handling of potentially unsupported webext APIs 2017-07-24 11:35:22 -04:00
gorhill
f328687663
implement user styles in webext platform 2017-07-23 11:33:39 -04:00
gorhill
6a53e6d0ac
minor code review 2017-07-04 09:33:03 -04:00
gorhill
a8382e821d
work around for #2734 until fixed in Nightly 2017-07-03 09:51:34 -04:00
gorhill
39aeaa12a7
new feature: element zapper 2017-05-27 11:51:24 -04:00
gorhill
0232382695
refactor static network filtering, add support for csp injection 2017-05-12 10:35:11 -04:00
gorhill
69b7dc3289
leveraging virtuous side-effect of using strictest setting for webrtc local IP address prevention, see https://github.com/uBlockOrigin/uAssets/issues/333#issuecomment-289426678 2017-03-27 10:09:10 -04:00
gorhill
7e55ddf16b re. websocket: mind backward compatibility 2017-03-06 17:53:25 -05:00
gorhill
c271fbbd0d code review: remove old cruft 2017-03-05 17:20:28 -05:00
gorhill
d7c1f2f919 fix sync storage for Firefox webext (#622) 2017-03-05 12:12:58 -05:00
gorhill
4d1ed37556 Firefox WebExt readiness (#622) + support more webRequest types when available (websocket, font, csp_report) 2017-03-05 08:25:55 -05:00
gorhill
39f9d11ec5 prepare uBO for fix to https://github.com/gorhill/uBO-Extra/issues/29 2017-02-18 09:01:36 -05:00
gorhill
a0c172c13e to mitigate https://github.com/gorhill/uBO-Extra/issues/7 2017-01-28 13:42:33 -05:00
gorhill
8d8905aab3 dont focus newly opened logger window: FF webext complains about it and not needed anyway 2017-01-07 10:57:16 -05:00
gorhill
cfa70bde7b minor code review 2016-12-07 09:49:43 -05: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
9b57b827d3 fix uncaught data: URI by popup blocker when URL is updated using location.replace() 2016-10-22 18:10:49 -04:00
gorhill
e01a130bc5 changes required to use chromium platform code for webext platform code 2016-10-19 10:20:26 -04:00
gorhill
cbefeb923c fix #1884 2016-10-14 10:06:34 -04:00
gorhill
e436a9be93 fix #2048 2016-10-05 06:52:43 -04:00
gorhill
d516e576ff reworded comment 2016-09-15 09:09:13 -04:00
gorhill
6e81771783 #1735: remove spurious whitespaces from data URI description fields 2016-09-15 09:06:22 -04:00
gorhill
0d7e326dce code review re. changes in chrome.privacy.network with Chromium 48 2016-08-31 17:28:10 -04:00
gorhill
83e66b36f1 patch or convert filters meant to target websocket network requests 2016-08-30 19:57:25 -04:00
gorhill
6c513629bf refactor content script code + add support for new :has & :xpath filters
Aside extending cosmetic filtering abilities, I expect this will
also take care of some long standing issues (I will have to find them
and mark them as "resolved" by this commit, as time allow).
2016-06-27 19:09:04 -04:00
gorhill
4dbdd39100 #1497: code review 2016-04-20 17:24:07 -04:00
gorhill
2d26d1dd3d this fixes #1497 2016-04-20 13:57:31 -04:00
gorhill
95d0ffafb7 this fixes #870 2016-03-22 10:19:41 -04:00
gorhill
1f345b585f this should fix #1276 2016-01-22 11:13:29 -05:00
gorhill
89148351e8 #1163: this implements "block elements by size" 2016-01-17 13:30:43 -05:00
gorhill
6b73b8c38c this fixes https://github.com/gorhill/uBlock/issues/533#issuecomment-167931681 2015-12-31 09:24:55 -05:00
gorhill
ce8ea0b31b reverting fix to #533 because bad side effects 2015-12-29 22:43:24 -05:00
gorhill
ea49484dd3 this fixes #1067 + partially fixes #1070 2015-12-15 10:40:40 -05:00