mozilla

Revision 435031 of mozbrowserusernameandpasswordrequired

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

Revision Content

{{ non-standard_header() }}

The mozbrowserusernameandpasswordrequired event is fired when the content within a browser {{HTMLElement("iframe")}} requires an HTTP authentification.

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:

host
A string representing the host requesting the HTTP authentification
realm
A string representing the value of the realm HTTP header.

Example

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

browser.addEventListener("mozbrowserusernameandpasswordrequired", function( event ) {
  console.log("The auth realm is:" + event.detail.realm);
});
  • {{event("mozbrowserasyncscroll")}}
  • {{event("mozbrowserclose")}}
  • {{event("mozbrowsercontextmenu")}}
  • {{event("mozbrowsererror")}}
  • {{event("mozbrowsericonchange")}}
  • {{event("mozbrowserloadend")}}
  • {{event("mozbrowserloadstart")}}
  • {{event("mozbrowserlocationchange")}}
  • {{event("mozbrowseropenwindow")}}
  • {{event("mozbrowsersecuritychange")}}
  • {{event("mozbrowsertitlechange")}}

See also

Revision Source

<p>{{ non-standard_header() }}</p>
<p>The <code>mozbrowserusernameandpasswordrequired</code> event is fired when the content within a browser {{HTMLElement("iframe")}} requires an HTTP authentification.</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>host</code></dt>
  <dd>
    A string representing the host requesting the HTTP authentification</dd>
  <dt>
    <code>realm</code></dt>
  <dd>
    A string representing the value of the <code>realm</code> HTTP header.</dd>
</dl>
<h2 id="Example">Example</h2>
<pre class="brush:js;">
var browser = document.querySelector("iframe[mozbrowser]");

browser.addEventListener("mozbrowserusernameandpasswordrequired", function( event ) {
  console.log("The auth realm is:" + event.detail.realm);
});</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("mozbrowseropenwindow")}}</li>
  <li>{{event("mozbrowsersecuritychange")}}</li>
  <li>{{event("mozbrowsertitlechange")}}</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