Bug 894882 - Make sure the correct host is displayed when prompting for WebRTC from iframes r=wesj

This commit is contained in:
Mark Finkle 2013-07-17 09:19:19 -04:00
parent 33daf36a24
commit 5a400869a0

View File

@ -82,7 +82,7 @@ var WebrtcUI = {
browser.ownerDocument.defaultView.navigator.mozGetUserMediaDevices(
function (devices) {
WebrtcUI.prompt(browser, callID, params.audio, params.video, devices);
WebrtcUI.prompt(windowID, callID, params.audio, params.video, devices);
},
function (error) {
Cu.reportError(error);
@ -156,7 +156,7 @@ var WebrtcUI = {
}
},
prompt: function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) {
prompt: function prompt(aWindowID, aCallID, aAudioRequested, aVideoRequested, aDevices) {
let audioDevices = [];
let videoDevices = [];
for (let device of aDevices) {
@ -183,7 +183,8 @@ var WebrtcUI = {
else
return;
let host = aBrowser.contentDocument.documentURIObject.asciiHost;
let contentWindow = Services.wm.getOuterWindowWithId(aWindowID);
let host = contentWindow.document.documentURIObject.host;
let requestor = BrowserApp.manifest ? "'" + BrowserApp.manifest.name + "'" : host;
let message = Strings.browser.formatStringFromName("getUserMedia.share" + requestType + ".message", [ requestor ], 1);