Bug 959230 - Use DOMWindowCreated events to add payments listeners. r=mfinkle

This commit is contained in:
Wes Johnston 2014-02-05 12:15:44 -08:00
parent 6ff8e54700
commit 90f61b9356

View File

@ -133,7 +133,7 @@ PaymentUI.prototype = {
let tab = content.BrowserApp.addTab(aPaymentFlowInfo.uri + aPaymentFlowInfo.jwt);
// Inject paymentSuccess and paymentFailed methods into the document after its loaded.
tab.browser.addEventListener("DOMContentLoaded", function loadPaymentShim() {
tab.browser.addEventListener("DOMWindowCreated", function loadPaymentShim() {
let frame = tab.browser.contentDocument.defaultView;
try {
frame.wrappedJSObject.mozPaymentProvider = {
@ -172,7 +172,7 @@ PaymentUI.prototype = {
} catch (e) {
_error(aRequestId, "ERROR_ADDING_METHODS");
} finally {
tab.browser.removeEventListener("DOMContentLoaded", loadPaymentShim);
tab.browser.removeEventListener("DOMWindowCreated", loadPaymentShim);
}
}, true);