Note that there are some explanatory texts on larger screens.

plurals
  1. POMonitor window opening, closing, DOMContentLoaded events for all current & future windows+tabs
    text
    copied!<p><b>Background:</b></p> <p>I'm <em>authorised</em> to "automate" a 3rd party site for the purpose of pushing "service orders" into it and monitoring the progress of those requests.</p> <p>I tried taking a normal "scraping" approach (using <code>WWW::Mechanize</code>, <code>HTML::Query</code>, etc from Perl) but ran into a <em>lot</em> of issues predicting what the JavaScript in the site would do under a variety of circumstances. I intend to go back to this approach if I ever receive support from the vendor of the product which runs the 3rd party site, or can get hold of some better documentation w.r.t business-rules of the product.</p> <p>To avoid second guessing the JavaScript code, and to save a lot of time, I ended up taking an approach were I load the 3rd party site in Firefox on a dedicated VM, and then execute "privileged" code (i.e: nsI*) in the context of the site to "drive" and "scrape" the site.</p> <p>I'm currently using <code>nsIWebProgressListener</code>/<code>DOMContentLoaded</code> (when I already have a reference to a ChromeWindow), and <code>nsIWindowMediator</code> window+tab enumeration called from <code>setInterval</code> to find new windows and tabs (when I have no way to predict them opening, nor gain a reference to their DOMWindow objects due to scoping of 3rd party JavaScript).</p> <p><b>Question:</b> How can I automatically install a "hook" into each Window/Tab opened now (and in the future) by the 3rd party site's JavaScript? Something like a "window watcher" <code>nsI~</code> interface for the whole of the Firefox UI would be very useful in this case.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload