Tabbed browser

  • Revision slug: Talk:Code_snippets/Tabbed_browser
  • Revision title: Tabbed browser
  • Revision id: 139786
  • Created:
  • Creator: Docwhat
  • Is current revision? No
  • Comment More questions.

Revision Content

Simplified code in "Detecting page load"

I rewrote this snippet to be a bit more simple

if (foo) { bar; quuz; } else { bar; }

was simplifiable to:

bar; if (foo) quuz;

I've also changed the comments to be clear about what was going on. GijsKruitbosch 11:49, 11 December 2006 (PST)

gBrowser, within an extension

removed confused section --Nickolay 09:14, 9 January 2007 (PST)

 	+	// gBrowser is only accessible from the scope of Firefox, to use gBrowser within an extension you must declare it
 	+	var gBrowser = document.getElementById("content");

Getting document of currently selected tab

Anyone mind if I change this to "Getting the window object of the currently selected tab", and include info that from the window, you can access the document, the URL, etc?--Np 10:52, 24 May 2007 (PDT)

Notification when a tab is removed

Does this include the last tab in a window (ie, when the window closes)? --Docwhat 13:37, 6 November 2007 (PST)

Detecting page unload

There is documentation for page load, but how does one detect page unload? --Docwhat 13:37, 6 November 2007 (PST)

Revision Source

<h3 name="Simplified_code_in_.22Detecting_page_load.22"> Simplified code in "Detecting page load" </h3>
<p>I rewrote this snippet to be a bit more simple
</p>
<pre class="eval">if (foo) { bar; quuz; } else { bar; }
</pre>
<p>was simplifiable to:
</p>
<pre class="eval">bar; if (foo) quuz;
</pre>
<p>I've also changed the comments to be clear about what was going on. <a href="User:GijsKruitbosch">GijsKruitbosch</a> 11:49, 11 December 2006 (PST)
</p>
<h3 name="gBrowser.2C_within_an_extension"> gBrowser, within an extension </h3>
<p>removed confused section <a class="external" href="http://developer.mozilla.org/en/docs/index.php?title=Code_snippets:Tabbed_browser&amp;curid=6415&amp;diff=46045&amp;oldid=45762&amp;rcid=46914"> --</a><a href="User:Nickolay">Nickolay</a> 09:14, 9 January 2007 (PST)
</p>
<pre> 	+	// gBrowser is only accessible from the scope of Firefox, to use gBrowser within an extension you must declare it
 	+	var gBrowser = document.getElementById("content");
</pre>
<h3 name="Getting_document_of_currently_selected_tab"> Getting document of currently selected tab </h3>
<p>Anyone mind if I change this to "Getting <i>the window object</i> of the currently selected tab", and include info that from the window, you can access the document, the URL, etc?--<a href="User:Np">Np</a> 10:52, 24 May 2007 (PDT)
</p>
<h3 name="Notification_when_a_tab_is_removed"> Notification when a tab is removed </h3>
<p>Does this include the last tab in a window (ie, when the window closes)? --<a href="User:Docwhat">Docwhat</a> 13:37, 6 November 2007 (PST)
</p>
<h3 name="Detecting_page_unload"> Detecting page unload </h3>
<p>There is documentation for page load, but how does one detect page unload? --<a href="User:Docwhat">Docwhat</a> 13:37, 6 November 2007 (PST)
</p>
Revert to this revision