Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Firefox: Getting list of loaded resources

by McA (Curate)
on Aug 21, 2013 at 12:09 UTC ( #1050338=perlquestion: print w/ replies, xml ) Need Help??
McA has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I would like to know which additional resources are loaded by a browser to display a fetched HTML page. As pages get more an more dynamic (e.g. Javascript loading resources, CSS background images loaded and applied), it's not only a job of parsing the initial page's html. (First steps done with Mojo.).

I want to give WWW::Mechanize::Firefox a try. So for all experts in this module. Is there a way to:

a) Access the cache usage setting in Firefox or simply resetting the cache?

b) Is there a chance to get a list of all loaded secondary resources, like the network monitor of Firebug is showing?

Hints and ideas welcome.

Best regards
McA

Comment on Firefox: Getting list of loaded resources
Re: Firefox: Getting list of loaded resources
by Corion (Pope) on Aug 21, 2013 at 16:29 UTC

    All the functionality that WWW::Mechanize::Firefox has for (not) using the cache can be found by searching its documentation for the keyword "cache". For example, the ->get method has the optional parameter $bypass_cache. Does that help your first question?

    For the loading and/or linked resources, I don't know, but I would look at how the Mozilla Live HTTP Headers do that, and then replicate that logic either in Perl, using WWW::Mechanize::Firefox and/or MozRepl::RemoteObject, or in Javascript. Note that the progressListener interface as documented by Mozilla might help you. It even has methods to access it in WWW::Mechanize::Firefox. Maybe you can help me make the documentation more accessible.

      Thank you for the hints.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1050338]
Approved by kcott
Front-paged by sparkyichi
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (16)
As of 2014-07-31 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (252 votes), past polls