Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Firefox: Getting list of loaded resources

by McA (Priest)
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

  • Comment on Firefox: Getting list of loaded resources

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1050338]
Approved by kcott
Front-paged by sparkyichi
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2017-06-27 19:50 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (612 votes). Check out past polls.