Getting a Remote JS file is not allowed in add-ons on Mozilla add-ons.
You can create a plain DB file and get it remotely but that would take a fair amount of time which will stop the extension working. In fact. it is not better than having the files internally.
I am familiar with your add-on. The best way is to create a text file just for the patterns, then read them on start up and create an array from them. Then use a single
webRequest.onBeforeRequest.addListener for all of them.
There are many ways to optimise the code.
An example would be to create patterns and pass them directly to
// a separate file for the patterns
// Get the file, read it into text… create an array
let pattern = fileText.split(/[\r\n]'/);
Now you have an array of patterns that you can pass to
Note they must be patterns which makes it easier
you can use this:
Instead of all these:
Then the listener