Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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
[marto]: good morning all

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-06-21 06:52 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.