I am trying to make plugins, for an extension (Anticontainer) for the Firefox add-on (DownThemAll).
So, I tried to get help actually writing add-ons for this but that did not work. I suspect either, anybody using this is running it completely independently, and they know the coding and just write everything themselves. Nobody is writing about it so I am not sure what kind of following it has.
Maybe they just delete any ticket posted on github so there is no trace of their support. It has no forums.
So, long story short. I gave up trying to get help.
I taught myself how to write regexp to make plugins. I fixed the Facebook plugin because apparently nobody else tried. Thorough Google search turned up maybe 3-4 posts simply stating "it stopped working", "ok".
So I gave up and taught myself how to write plugins for it.
It works, however, I keep running into this damned problem. It took me far more time than it should of to get the Facebook album downloader plugin to work than it should have.
The issue is, and this is very specific through hours of breaking down each plugin to figure out what caused it and what didn't is, with certain RegExp strings in the "resolver" (plugin type), "finder" domain, stop the plugin from being imported.
Frankly, I have figured out why it doesn't work (Anticontainer, or DownThemAll or Firefox) won't import it. I change just the finder domain to some basic RegExp string and it will import, but obviously the plugin won't, because the finder sequence is not matching the part of the site I want (the part that is embedded in the source text that I want to download).
That's the background of the issue. Long story short. Anticontainer plugins won't import because it finds something wrong with the RegExp sequence of the "finder" domain of the plugin. Problem is, Anticontainer does not give any indication as to why it wont import.
Simply, if it works, it says "successfully imported". If it does not work, nothing happens. Import dialog closes and the plugin doesn't show up.
Using Firefox's error console has returned a vary vague error for this.
Any time a plugin fails to import to AntiContainer, that shows up. If it imports correctly, that does not show up.Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIJSON.decodeFromStream]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://dtaac/plugins.jsm :: loadPluginFromStream :: line 211" data: no]
The plugins are .JSON files. That error points to this line of code
. This is part of the following functionreturn validatePlugin(nsJSON.decodeFromStream(stream, size));
./**
* Loads a plugin directly from a nsIInputStream
* @param stream Stream to load from
* @param size Size to read from the Stream
* @return Loaded plugin
*/
function loadPluginFromStream(stream, size) {
return validatePlugin(nsJSON.decodeFromStream(stream, size));
}
This loadPluginFromStream is called one other time in the code in the following function (immediately below the one I just mentioned).
These are from the plugins file at .function loadPluginFromFile(file) {
if (!(file instanceof Ci.nsIFile)) {
file = new LocalFile(file);
}
let fs = new FileInputStream(file, 0x01, 0, 1<<2);
let o = loadPluginFromStream(fs, file.size);
fs.close();
o.file = file;
o.date = file.lastModifiedTime;
return o;
}
I have tried countless methods to figure out why certain RegExp in the "finder" domain of the plugin will cause the plugin to import or not.
How can i figure out what format the original writers of this code want their RegExp.
For example, simple plugin will import with
but it will not if I have"finder": "<img src=\"(resized/([^\"]+))\"",
Both are valid RegExp according to the tester I use, RegExr."finder": "src="(http://.*.cdn..*.com.*-\d+x\d+.jpg)"\Wclass="",
I am at a loss. How can i figure out why this code thinks one RegExp string is correct while another isn't.
That is, "finder": "src="(http://.*.cdn..*.com.*-\d+x\d+.jpg)"\Wclass="", throws the Firefox error listed above, while the other does not. I can not figure out if it's an issue with my RegExp or something else.
Suggestions?