Using Firebug I have extracted all the links of a web page using:
var links = document.getElementsByTagName("a");
for(var i=0; i<links.length; i++) {
console.log(links[i].href);
}
now all the links are in the console and they are in the format:
javascript:tenderLog1('abcd.pdf','test','23');
Now I want to pass this string output as a Firebug js command so that all the links get opened automatically.
Is there any function to pass js variable as a Firebug command?
It’s a bit hard to guess what exactly you want to achieve. I guess that you want instead of
to do
? This would be equivalent to invoking
tenderLog1('abcd.pdf','test','23')from Firebug console in the example you’ve provided. The outcome depends on whattenderLog1functions does of course.But perhaps it would be cleaner to see what the function does (
window.open?), and provide commands after parsing the parameters with some regular expression.