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

Replies are listed 'Best First'.
Re: Firefox: Getting list of loaded resources
by Corion (Patriarch) 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.