mozbrowseropenwindow

  • Revision slug: Web/Reference/Events/mozbrowseropenwindow
  • Revision title: mozbrowseropenwindow
  • Revision id: 444223
  • Created:
  • Creator: kscarfone
  • Is current revision? Yes
  • Comment Editorial review

Revision Content

{{ non-standard_header() }}

The mozbrowseropenwindow event is fired when the content of a browser {{HTMLElement("iframe")}} successfully calls the {{domxref("window.open()")}} method.

General info

Specification
Non standard
Interface
{{domxref("CustomEvent")}}
Bubbles
Yes
Cancelable
Yes
Target
{{HTMLElement("iframe")}}
Default Action
None

Properties

{{OpenEventProperties("The browser iframe")}}{{CustomEventProperties("object","A custom object")}}{{CloseEventProperties()}}

Detail

The detail property is an anonymous JavaScript object with the following properties:

url
A string representing the URL of the document loaded within the frameElement.
name
The name of the new browser window.
features
A string of features represented by a list of names and values separated by commas. For a complete list of possible features, see {{domxref("window.open()")}}.
frameElement
A DOM node representing the new browser {{HTMLElement("iframe")}} embedding the new content.

Example

var browser = document.querySelector("iframe[mozbrowser]");

browser.addEventListener("mozbrowserasyncscroll", function( event ) {
  console.log("The scroll top position of the document is:" + event.detail.top + "px");
});
  • {{event("mozbrowserasyncscroll")}}
  • {{event("mozbrowserclose")}}
  • {{event("mozbrowsercontextmenu")}}
  • {{event("mozbrowsererror")}}
  • {{event("mozbrowsericonchange")}}
  • {{event("mozbrowserloadend")}}
  • {{event("mozbrowserloadstart")}}
  • {{event("mozbrowserlocationchange")}}
  • {{event("mozbrowsersecuritychange")}}
  • {{event("mozbrowsertitlechange")}}
  • {{event("mozbrowserusernameandpasswordrequired")}}

See also

Revision Source

<p>{{ non-standard_header() }}</p>
<p>The <code>mozbrowseropenwindow</code> event is fired when the content of a browser {{HTMLElement("iframe")}} successfully calls the {{domxref("window.open()")}} method.</p>
<h2 id="General_info">General info</h2>
<dl>
  <dt style="clear: left; float: left; text-align: right; width: 120px;">
    Specification</dt>
  <dd style="margin: 0 0 0 120px;">
    <em>Non standard</em></dd>
  <dt style="clear: left; float: left; text-align: right; width: 120px;">
    Interface</dt>
  <dd style="margin: 0 0 0 120px;">
    {{domxref("CustomEvent")}}</dd>
  <dt style="clear: left; float: left; text-align: right; width: 120px;">
    Bubbles</dt>
  <dd style="margin: 0 0 0 120px;">
    Yes</dd>
  <dt style="clear: left; float: left; text-align: right; width: 120px;">
    Cancelable</dt>
  <dd style="margin: 0 0 0 120px;">
    Yes</dd>
  <dt style="clear: left; float: left; text-align: right; width: 120px;">
    Target</dt>
  <dd style="margin: 0 0 0 120px;">
    {{HTMLElement("iframe")}}</dd>
  <dt style="clear: left; float: left; text-align: right; width: 120px;">
    Default Action</dt>
  <dd style="margin: 0 0 0 120px;">
    None</dd>
</dl>
<h2 id="Properties">Properties</h2>
<p>{{OpenEventProperties("The browser iframe")}}{{CustomEventProperties("object","A custom object")}}{{CloseEventProperties()}}</p>
<h3 id="Detail">Detail</h3>
<p>The <code>detail</code> property is an anonymous JavaScript object with the following properties:</p>
<dl>
  <dt>
    <code>url</code></dt>
  <dd>
    A string representing the URL of the document loaded within the <code>frameElement</code>.</dd>
  <dt>
    <code>name</code></dt>
  <dd>
    The name of the new browser window.</dd>
  <dt>
    <code>features</code></dt>
  <dd>
    A string of features represented by a list of names and values separated by commas. For a complete list of possible features, see {{domxref("window.open()")}}.</dd>
  <dt>
    <code>frameElement</code></dt>
  <dd>
    A DOM node representing the new browser {{HTMLElement("iframe")}} embedding the new content.</dd>
</dl>
<h2 id="Example">Example</h2>
<pre class="brush:js;">
var browser = document.querySelector("iframe[mozbrowser]");

browser.addEventListener("mozbrowserasyncscroll", function( event ) {
  console.log("The scroll top position of the document is:" + event.detail.top + "px");
});</pre>
<h2 id="Related_Events">Related Events</h2>
<ul>
  <li>{{event("mozbrowserasyncscroll")}}</li>
  <li>{{event("mozbrowserclose")}}</li>
  <li>{{event("mozbrowsercontextmenu")}}</li>
  <li>{{event("mozbrowsererror")}}</li>
  <li>{{event("mozbrowsericonchange")}}</li>
  <li>{{event("mozbrowserloadend")}}</li>
  <li>{{event("mozbrowserloadstart")}}</li>
  <li>{{event("mozbrowserlocationchange")}}</li>
  <li>{{event("mozbrowsersecuritychange")}}</li>
  <li>{{event("mozbrowsertitlechange")}}</li>
  <li>{{event("mozbrowserusernameandpasswordrequired")}}</li>
</ul>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/WebAPI/Browser" title="/en-US/docs/WebAPI/Browser">Using the Browser API</a></li>
</ul>
Revert to this revision