/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// The C++ side passes an nsIWritablePropertyBag2 through nsIWindowWatcher // containing the token name and a unique id scoping the observer // notifications, so a concurrent protected-auth dialog won't react to ours.
let args = window.arguments[0].QueryInterface(Ci.nsIWritablePropertyBag2);
let tokenName = args.getPropertyAsAString("tokenName");
let promptId = args.getPropertyAsAString("promptId");
// Register at script parse time as a defense against a slow DOMContentLoaded // — the C++ side can't deliver this notification before the dialog window // exists, but it can fire before our load handler has run.
Services.obs.addObserver(function observer(_subject, _topic, data) { if (data !== promptId) { return;
}
Services.obs.removeObserver(observer, "pk11-protected-auth-complete");
window.close();
}, "pk11-protected-auth-complete");
// Cancel button on the <dialog> element. Notify the C++ side so it can // return SECFailure immediately; the window will close itself afterwards // via the default dialogcancel handling.
document.addEventListener("dialogcancel", () => {
Services.obs.notifyObservers(null, "pk11-protected-auth-cancel", promptId);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.