Regex for UserScripts rules?

I’ve mostly migrated my MV2 extension to MV3, but there’s one feature that I’m finding it impossible to migrate: the ability to inject user-defined HTML script elements into the web page. Looking at the new UserScripts API, the fundamental problem is that the URL matching rules seem very limited and don’t fit with the URL matching algorithm of my own extension. Is there any way to get regex support? The “matches”, “excludeMatches”, “includeGlobs”, and “excludeGlobs” keys seem quite primitive and arbitrarily limited.

My extension has always checked the URL at page load time and has a “best match” algorithm, which is a poor fit for UserScripts static rules. Even if I could use regex, which as far as I can tell isn’t possible, I would have to add a bunch of “excludes” to every user script rule to handle possible overlaps of the user settings, which is awkward, overly complex, and possibly slow.

Read more here: Source link