mozbrowserclose

  • Revision slug: Web/Reference/Events/mozbrowserclose
  • Revision title: mozbrowserclose
  • Revision id: 431999
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment

Revision Content

{{ non-standard_header() }}

The mozbrowserclose event is fired when the content of a browser {{HTMLElement("iframe")}} call the {{domxref("window.close()")}} 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()}}

Example

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

browser.addEventListener("mozbrowserclose", function( event ) {
  console.log("Asking for close:" + JSON.stringify(event.detail));
});
  • {{event("mozbrowserasyncscroll")}}
  • {{event("mozbrowsercontextmenu")}}
  • {{event("mozbrowsererror")}}
  • {{event("mozbrowsericonchange")}}
  • {{event("mozbrowserloadend")}}
  • {{event("mozbrowserloadstart")}}
  • {{event("mozbrowserlocationchange")}}
  • {{event("mozbrowseropenwindow")}}
  • {{event("mozbrowsersecuritychange")}}
  • {{event("mozbrowsershowmodalprompt")}}
  • {{event("mozbrowsertitlechange")}}
  • {{event("mozbrowserusernameandpasswordrequired")}}

See also

Revision Source

<p>{{ non-standard_header() }}</p>
<p>The <code>mozbrowserclose</code> event is fired when the content of a browser {{HTMLElement("iframe")}} call the {{domxref("window.close()")}} 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>
<h2 id="Example">Example</h2>
<pre class="brush:js;">
var browser = document.querySelector("iframe[mozbrowser]");

browser.addEventListener("mozbrowserclose", function( event ) {
  console.log("Asking for close:" + JSON.stringify(event.detail));
});</pre>
<h2 id="Related_Events">Related Events</h2>
<ul>
  <li>{{event("mozbrowserasyncscroll")}}</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("mozbrowseropenwindow")}}</li>
  <li>{{event("mozbrowsersecuritychange")}}</li>
  <li>{{event("mozbrowsershowmodalprompt")}}</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