Subscribe to RSS Feed

Firebug command line allows executing JavaScript expressions within context of the current page. Firebug also provides a set of built in APIs and one of them is cd().

cd(window) By default, command line expressions are relative to the top-level window of the page, cd() allows you to use the window of a frame in the page instead.

There is several ways how to use this method. First, let's imagine following page:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Console Test Page</title>
</head>
<body>
    <iframe id="frameID" name="frameName" src="iframe.html" />
</body>
</html>
  • cd(document.getElementById("frameID").contentWindow); switch to a frame by ID
  • cd(window.frames[0]); switch to the first frame in the list of frames
  • cd(window.frames["frameName"]); switch to a frame using by name
  • cd(window.top); switching back to the top level window

Check the example page online.


Rss Commenti

10 Comments

  1. [...] Software is hard | Firebug Tip: using command line within an iframe [...]

    #1 Winning At The Slots | Solar Kits
  2. [...] Software is hard | Firebug Tip: using command line within an iframe [...]

    #2 Medal of Honor: History Channel: Battle For the Pacific Special Edition (with Modern Marvels: Strategic Air Command) » Medal of Honor
  3. I've always wanted that... thanks!

    #3 Ozten
  4. [...] Software is hard | Firebug Tip: using command line within an iframe [...]

    #4 - – Hacking Pokemon indigo
  5. Honza, thanks for sharing this useful tip. Before I had to right click the iframe and choose Display Only This Iframe (or something similar)

    #5 Andrei
  6. [...] Software is hard | Firebug Tip: using command line within an iframe [...]

    #6 [WATCH]: How To Get Command & Conquer 4 For The PC For Free ( Private Tracker Fast Download ) » Command & Conquer 4 Tiberian Twilight
  7. [...] Software is hard | Firebug Tip: using command line within an iframe (tags: firebug <iframe>) [...]

    #7 links for 2011-02-22 « sonofbluerobot
  8. [...] Software is hard | Firebug Tip: using command line within an iframe [...]

    #8 Rapid Prototyping with Sinatra | Web Design Course Brisbane: Next Course Wed 20th Apr 2011
  9. F* YEAH! no more "Load frame in a new tab" 😀

    #9 Ivan
  10. [...] Software is hard | Firebug Tip: using command line within an iframeFeb 17, 2011 … Software is hard | Firebug Tip: using command line within an iframe [...] #2 Medal of Honor: History Channel: Battle For the Pacific Special … [...]

    #10 Iframe command | Jefftracy

Sorry, the comment form is closed at this time.