Redirect conflict with uBlock Origin
Type: other
This extension failed to redirect a network request to https://s7.addthis.com/js/300/addthis_widget.js#pubid=tenthamendment because another extension (uBlock Origin) redirected it to chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/web_accessible_resources/af3c919ee9a3d97f5dedaf2f8bec146a.javascript?secret=qqesz4qhqw5h.
Looks like a surrogate redirect conflict?
@gorhill
But it sounds like these reporters should have seen the same error before, except it would have been to data: instead of web_accessible_resources, right?
I did some digging on the Chromium bug tracker and it may have something to do with the following lines:
https://codereview.chromium.org/9857009/diff/1003/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
Possibly related https://bugs.chromium.org/p/chromium/issues/detail?id=800773
does not affect the functionality of either uBlock or HTTPS Everywhere
It could affect uBO: if the request is redirect by HTTP-Everywhere first, this will prevent uBO from redirecting to a local neutered resource, meaning a network request meant to be blocked would no longer be blocked. On the other hand, if uBO redirects first, this won't affect the purpose of HTTPS-Everywhere.
It affects the functionality when you don't use a myopic technical lens. HTTPSeverywhere and uBlock origin are fighting - reddit nerds condescend about using some matrix plugin and various other hardcore solutions that aren't practical for average users. They stop using either one and leave bad reviews - likely on HTTPSEverywhere, which is where I had to go see the big red error after chrome made it seem like my extensions were exploding. Less people WILL use the extension as a result. And if a programmer using HTTPS everywhere and ublock origin with decentraleyes and privacy badger disabled (I have different extension profiles), even I'm not likely to just move to privacy badger and leave ublock behind after customizing it and getting familiar with it, It's just the truth.
At the end of the day, I can make sure I'm using HTTPS when it matters most (and in general), I can't block my own ads (dev tools doesnt count) so I would drop HTTPS everywhere.
(Copied from https://github.com/gorhill/uBlock/issues/3639#issuecomment-376125053)
I won't tell people what to do. I will tell what is happening, and from this people can decide for themselves. One of two cases can happen:
The error message is a result of two extensions trying to redirect the same network request: the Chrome/WebExtensions API allows only one extension to redirect a network request. Extensions are not made aware that their redirection failed. The reason for this is probably technical: conceptually extensions execute in parallel.
uBO redirect wins
Benign.
Typically the error message "This extension failed to redirect a network request..." will be with HTTPS-Everywhere in the Extensions page (as reported in opening comment).
This won't affect the purpose of HTTPS-Everywhere -- because no network requests is fired to the outside world.
HTTPS-Everywhere redirect wins
~~Serious~~ Benign.
Typically the error message "This extension failed to redirect a network request..." will be with uBlock Origin in the Extensions page.
~~This will prevent uBO from redirecting the network request to a local neutered resource, meaning a network request which was meant meant to be blocked by uBO would no longer be blocked.~~ uBO won't be able to redirect the original http: network request, because this one will be redirected by HTTPS-Everywhere to a secure https: connection. However, uBO will properly redirect the https: request to its local neutered resource, because of course HTTPS-Everywhere won't touch this one.
Considerations
The order in which the extensions were installed is what decide which extension will redirect first (~~I can't remember the order~~ the last one installed wins -- thanks @Bisaloo) -- ~~so this means by re-installing one or the other you could move from the "serious" to the "benign" case.~~ So mainly either ways all work as expected except that you will have to tolerate the warnings in the Extensions page.
When a secure page (https) tries to pull a script from an unsecure location (http), the browser will refuse, mixed active content has been forbidden by browsers since quite a while now. So in that case, HTTPS-Everywhere is not really needed.
Why is this error more widely reported now? I have no clue, uBO has been redirecting to neutered resources since a very long time now (see #1170). Somebody on HTTPS-Everywhere's issue tracker pointed out that something related to extension error was fixed in Chrome 65.
AFIAK, using both uBO and HTTPSE together has been causing issues for a long time due to the limitation in the webRequest APIs (namely only one extension is allowed to rewrite/ ~block~ a request, without notifying the extension losing the race). This is becoming an critical issue when Chrome 65 start displaying the runtime errors in the UI.
cc @Hainish as this might discourage the users from using HTTPSE...
@gorhill fixed. thank.
only one extension is allowed to rewrite/ block a request
Blocking is not an issue -- if one extension orders a network request to be blocked, it will be blocked regardless of what other extensions decide. The issue is only when two or more extensions redirect. This is not an issue when the two extensions have similar purpose (uBO/Ghostery), but here we have two extensions with a different purpose.
Could someone please provide a URL where I can go to see the problem happen? I asked for this in https://github.com/EFForg/https-everywhere/issues/14961#issuecomment-375440957, but so far all the reports here just describe the error and not where they are seeing it.
@jeremyn chrome://extensions
@webvictim Thanks, but I mean more like "If I go to https://example.com I get an error."
But it sounds like people are primarily seeing this reported against the extension, and not against the site, so that may be why people are having a difficult time identifying a specific site that triggers the error.
I found a case, which might be the one from OP (I used the pubid=tenthamendment in his link to find a site with such URL): http://blog.tenthamendmentcenter.com/.
After testing the case on my side, I realize I made a mistake in my assessment above: I did not take into account that the redirected network request by HTTPS-E will be further re-evaluated by all extensions, including uBO of course. This means that uBO will still properly redirect to its neutered resource after HTTPS-E redirects to the https version of the resource. Once the https version is fired, HTTPS-E will leave this one alone, while uBO will this time be able to redirect to its neutered local resources. I will correct my post above.
@gorhill Thanks, I can confirm that I get red error text at chrome://extensions/ for HTTPS Everywhere after I visit http://blog.tenthamendmentcenter.com/ while having both HTTPS Everywhere and uBlock Origin installed. I also originally got an exclamation mark on a yellow background near the top right of the Chrome window, which I somehow dismissed, and now I don't know how to get the exclamation mark back again. Also I'm not sure how to get rid of the red error text at chrome://extensions/ besides disabling and re-enabling HTTPS Everywhere.
I can confirm I am getting the same error. Would the user only notice it by going to chrome://extensions/ ?
@wonderchook The exclamation mark with the yellow background I mentioned was visible on the main screen.
@jeremyn okay, I see. I had recently updated Chrome so it is covered up by a green arrow asking me if I want to customize chrome. Once I dismissed the exclamation mark underneath the green arrow it appears not possible to get it back.
Is there any reason the Chromium team could not add an exception for chrome-extension:// as they did before for data:// (see https://codereview.chromium.org/8802017)?
This just started happening for me a few days ago. On 2 URLs that I've noticed. Got a screenshot of one, don't recall the other. https://imgur.com/a/jqIds
Yes, the website was tenthamendmentcenter.com. Thanks @gorhill
We could avoid this conflict by using the WebExtensions onMessageExternal handler: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onMessageExternal. If uBlock Origin sends a message to us saying "uBlock Origin is installed" or "uBlock origin is about to redirect so and so resource", then we could pre-emptively block our own redirects for these specific resources.
@gorhill can we collaborate on making this possible?
@ghostwords has raised the point that this probably won't work, since onMessageExternal is an async handler. The message will arrive too late, and blocking on message receipt would introduce an unacceptable delay. This seems like something they'll have to fix on the Chromium side. There is a bug open for this: https://bugs.chromium.org/p/chromium/issues/detail?id=805704. This issue does not resolve the conflicts between extensions, but seems like a good place to raise the point that scaring users with the current UX likely injures user retention rates.