Closed
Bug 882495
Opened 12 years ago
Closed 12 years ago
PermissionPromptHandler does not return the correct window on Android
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox25 | --- | fixed |
People
(Reporter: stully, Assigned: stully)
References
Details
Attachments
(1 file)
1.88 KB,
patch
|
gwagner
:
review+
|
Details | Diff | Splinter Review |
When called by ContactManager, the window returned by getMostRecentWindow() is not correct which causes problems when trying to display a content permission prompt on Android.
![]() |
Assignee | |
Comment 1•12 years ago
|
||
This works for the ContactManager case, but I assume that this will break anything else that utilizes PermissionPromptHelper; not sure how to handle this.
Assignee: nobody → stully
Attachment #761801 -
Flags: feedback?(jonas)
![]() |
Assignee | |
Comment 2•12 years ago
|
||
Comment on attachment 761801 [details] [diff] [review]
Get window for permission prompt by outer window ID instead of most recent window
Changing to review since the tests passed: https://tbpl.mozilla.org/?tree=Try&rev=30609e528de0
Attachment #761801 -
Flags: feedback?(jonas) → review?(jonas)
![]() |
Assignee | |
Comment 3•12 years ago
|
||
Comment on attachment 761801 [details] [diff] [review]
Get window for permission prompt by outer window ID instead of most recent window
>From: Shane Tully <stully@mozilla.com>
>Bug 882495: Get window for permission prompt by outer window ID instead of most recent window
>
>diff --git a/dom/contacts/ContactManager.js b/dom/contacts/ContactManager.js
>--- a/dom/contacts/ContactManager.js
>+++ b/dom/contacts/ContactManager.js
>@@ -730,17 +730,18 @@ ContactManager.prototype = {
>
> let principal = this._window.document.nodePrincipal;
> cpmm.sendAsyncMessage("PermissionPromptHelper:AskPermission", {
> type: "contacts",
> access: access,
> requestID: requestID,
> origin: principal.origin,
> appID: principal.appId,
>- browserFlag: principal.isInBrowserElement
>+ browserFlag: principal.isInBrowserElement,
>+ windowID: this._window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).outerWindowID
> });
> },
>
> save: function save(aContact) {
> let request;
> if (DEBUG) debug("save: " + JSON.stringify(aContact) + " :" + aContact.id);
> let newContact = {};
> newContact.properties = {
>diff --git a/dom/permission/PermissionPromptHelper.jsm b/dom/permission/PermissionPromptHelper.jsm
>--- a/dom/permission/PermissionPromptHelper.jsm
>+++ b/dom/permission/PermissionPromptHelper.jsm
>@@ -81,17 +81,17 @@ this.PermissionPromptHelper = {
> // create a nsIContentPermissionRequest
> let request = {
> type: msg.type,
> access: msg.access ? msg.access : "unused",
> principal: principal,
> QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionRequest]),
> allow: aCallbacks.allow,
> cancel: aCallbacks.cancel,
>- window: Services.wm.getMostRecentWindow("navigator:browser")
>+ window: Services.wm.getOuterWindowWithId(msg.windowID)
> };
>
> permissionPromptService.getPermission(request);
> return;
> }
>
> if (permValue == Ci.nsIPermissionManager.ALLOW_ACTION) {
> aCallbacks.allow();
Attachment #761801 -
Flags: review?(jonas) → review?(anygregor)
Updated•12 years ago
|
Attachment #761801 -
Flags: review?(anygregor) → review+
Comment 4•12 years ago
|
||
status-firefox25:
--- → fixed
![]() |
Assignee | |
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
![]() |
||
Comment 5•12 years ago
|
||
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•