Quote
JamesD
2) What text should the menu item contain? Right now it says, "All links in Window".
That is where I was pointing too.
If the request is focused to extract links types, there should be 2 more options.
What I meant with an array check, is because the injectJS should check which links to return based on the two options.
In the original XPI file there are two files: fileextensions.js and filesharingsites.js which contain the arrays to check against.
My idea is to let the user download the updated the XPI and extract those files to a macro subfolder for this macro. Then, based in the menu option chosen make a readfile to those files and include in the injectJS code with a while loop to check.
In other words (this is draft, and I'm writting it while posting and therefore hasn't been tested; variable naming is just the idea):
NOTE: code might be wrong, we need to join opinions before implement.
$varcheck = "var copyalllinks = ['//']";
_Snippet_taprueba3 {
$_tadf3 = injectJS("(function(u){".$varcheck."var cal; copyalllinks ? cal = copyalllinks : typeof CopyAllLinks.fileExtensions !== 'undefined' ? cal = CopyAllLinks.fileExtensions : typeof CopyAllLinks.fileSharingSites !== 'undefined' ? cal = CopyAllLinks.fileSharingSites : false ; var cnt = 0; while(cnt < cal.length){ u = document.links[".$_ucount."].href; if(u.indexOf(cal[cnt]) != -1){return u; break;} cnt++;} return false;})();");
$_taf3 != "false" ? $_taprueba = $_taprueba."\n-> ".$_tadf3 : 0 ;
}
menuoptionforalllinks{
&_Snippet_taprueba3;
}
menuoptionforextensions{
$varcheck = readfile(path to fileextensions.js);
&_Snippet_taprueba3;
}
menuoptionforsharingsites{
$varcheck = readfile(path to filesharingsites.js);
&_Snippet_taprueba3;
}
Edited 3 time(s). Last edit at 06/28/2016 02:06PM by JohnHell.