Rule with id XX specified a more complex regex than allowed as part of the regexFilter key

144 views
Skip to first unread message

Don Schmitt

unread,
Dec 15, 2023, 12:43:08 PM12/15/23
to chromium-extensions
According to the declarativeNetRequest docs, this error will only happen if a compiled regex is more than 2KB.

I am getting this error on the following regex, which doesn't look terribly complex to me, am I missing something obvious or do you think this is a bug?

CONSOLE LOG:
adding rule id: 3, rule: https:\/\/.*\.blahblah\.net\/test_demo\/generic2\/STRUTS\/callStrutsSecure\.jsp\?app=coupons&bridge=\/COUPONPROMO\/coupon_bridge\.jsp

ERROR:
Uncaught (in promise) Error: Rule with id 3 specified a more complex regex than allowed as part of the "regexFilter" key.


Patrick Kettner

unread,
Dec 15, 2023, 12:57:48 PM12/15/23
to Don Schmitt, chromium-extensions
Hey Don!
Could you file a bug on crbug.com with reproducible steps?

thanks!

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/CAM7AMp%2BUHDxd3x_V%2BsPh5q_9JVZrU46_AwbBxeUTQE-NhiaKQg%40mail.gmail.com.

Don Schmitt

unread,
Dec 15, 2023, 1:28:55 PM12/15/23
to Patrick Kettner, chromium-extensions
Hi Patrick,

Okay, I found a related bug, 


that I think covers it.  It appears you can't have a regex over 111 characters long, much less than the 2KB compiled size in the docs:  https://bugs.chromium.org/p/chromium/issues/detail?id=1309190

This seems like a significant bug and it is an MV3 showstopper for us, but it hasn't been touched all year, any way to bump the priority?

Thanks!
--
Don

Patrick Kettner

unread,
Dec 15, 2023, 1:38:05 PM12/15/23
to Don Schmitt, chromium-extensions
Hi Don
Just to clarify, the 2kb limit is for the entire rule. I will reach out to the engineering team to see if there is anything that can be done on crbug.com/316597968

Patrick Kettner

unread,
Dec 15, 2023, 1:41:47 PM12/15/23
to Don Schmitt, chromium-extensions
Apologies I meant crbug.com/1309190

wOxxOm

unread,
Dec 16, 2023, 3:09:57 AM12/16/23
to Chromium Extensions, Patrick Kettner, chromium-extensions, Don Schmitt

Nina Bobo

unread,
Dec 16, 2023, 3:49:38 AM12/16/23
to Chromium Extensions, wOxxOm, Patrick Kettner, chromium-extensions, Don Schmitt

Don Schmitt

unread,
Dec 16, 2023, 12:03:39 PM12/16/23
to wOxxOm, Chromium Extensions, Patrick Kettner
Sheesh, these examples are so simple, I'm really surprised adblockers aren't running into this. In our case, IT departments are adding the URL filters, often by copy / paste, so a 112-character filter would not be an outlier at all.

Is there a way in crbug to tag something as "MV3 blocker"?

wOxxOm

unread,
Dec 16, 2023, 12:05:47 PM12/16/23
to Chromium Extensions, Don Schmitt, Chromium Extensions, Patrick Kettner, wOxxOm
A temporary workaround is to write a converter for such cases.

Don Schmitt

unread,
Dec 16, 2023, 1:13:12 PM12/16/23
to wOxxOm, Chromium Extensions, Patrick Kettner
Sorry, I don't grok.  A converter?  Can you elaborate?

wOxxOm

unread,
Dec 16, 2023, 1:15:37 PM12/16/23
to Chromium Extensions, Don Schmitt, Chromium Extensions, Patrick Kettner, wOxxOm
It's possible to convert such patterns that don't use advanced regex features to urlFilter syntax. You can write such a converter.

Don Schmitt

unread,
Dec 16, 2023, 1:27:01 PM12/16/23
to wOxxOm, Chromium Extensions, Patrick Kettner
Oh!  Thanks for the suggestion, I thought you were originally implying that this bug would _also_ happen with urlFilter not that urlFilter could be used as a workaround.  Yeah, this particular case could be converted to urlFilter, but that can't be algorithmically done with any possible user regex filter input, which is what we have implemented now with MV2 webRequestBlocking.

Reply all
Reply to author
Forward
0 new messages