by judge2020 · 3mo ago · 0 comments
Interestingly, the rule count limits themselves do not (currently) seem to be much an issue despite it being one of the more common concerns on the original MV3 announcement.
This isn't an MV3 issue, it's a Chromium design decision that extensions cannot block browser initialization. It was also true with MV2. In fact, MV3 has improved the situation because DNR rules are enforced immediately.
You could certainly argue that Chrome should allow extensions to block browser initialization, or that it should be user configurable - but it seems like an entirely defensible Chrome decision. Regardless, it's nothing to do with MV3.
> the filter rules aren't as flexible.
That's true, but they are still very flexible, and DNR makes some very nice features possible in uBO lite that were not possible in uBO.
For example, did you know that you can change your User-Agent with uBO lite? Go to the Custom DNR rules tab, and enter something like this to pretend to be Lynx on whatever.com:
id: 5
priority: 100
action:
type: modifyHeaders
requestHeaders:
- header: User-Agent
operation: set
value: Lynx/2.9.2 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/3.5.7
condition:
requestDomains:
- whatever.com
resourceTypes:
- main_frame
I don't think that's possible in uBO, so clearly there are some benefits to switching. I have a ton of custom dnr rules, and love this feature.That said,
> Chromium design decision that extensions cannot block browser initialization
It's not "browser initialization" that was blocked, it was blocking network requests for pages until they were processed by all components in the chain. Notably, this could never apply applied to the browser or its internal pages itself.
> It was also true with MV2.
With MV2 you used the blocking version of https://developer.chrome.com/docs/extensions/reference/api/w... which no longer works with MV3 extensions in Chrome and then the request had to wait until it was given to and processed by the blocker.
Firefox is a great example about all of the above points: MV3 still supports blockingWebRequest there, so it gets the best of both worlds.
> did you know that you can change your User-Agent with uBO lite?
With MV2 you'd use blocking webRequest and chrome.webRequest.onBeforeSendHenders. I'm not sure uBO ever bothered with this before uBO Lite, but it's a bit of a double standard to say "MV2 didn't offer blocking requests, that was a different API which happ
Despite the name, the requests were not blocked until the extension had initialized. The browser could make network requests before that happened with MV2. With MV3, static rulesets and persistent DNR rules are enforced immediately.
> With MV2 you'd use blocking webRequest and chrome.webRequest.onBeforeSendHenders
Of course an extensions could do this, I said uBO lite. DNR made exposing this powerful functionality fast and easy. My point is that MV3 uBO lite has useful features that MV2 uBO does not.
That issue does not exist for uBO Lite. I specifically wrote in the FAQ under "What are the upsides of an MV3-based content blocker?":
> For Chromium-based browsers specifically, MV3-based content blockers which are entirely declarative will properly filter at browser launch, which is not the case for MV2-based content blockers
uBO Lite is entirely declarative, so it filters properly at browser launch, and I literally give an actual example of this in the following section, search for "filters properly at browser launch".