mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Use origin instead of documentURI for WebRTC permission requests, when available.
This commit is contained in:
parent
04caaa6539
commit
39e63a6981
2 changed files with 8 additions and 1 deletions
|
|
@ -208,6 +208,7 @@ function prompt(aContentWindow, aWindowID, aCallID, aConstraints, aDevices, aSec
|
|||
let request = {
|
||||
callID: aCallID,
|
||||
windowID: aWindowID,
|
||||
origin: aContentWindow.origin,
|
||||
documentURI: aContentWindow.document.documentURI,
|
||||
secure: aSecure,
|
||||
requestTypes: requestTypes,
|
||||
|
|
|
|||
|
|
@ -290,7 +290,13 @@ function prompt(aBrowser, aRequest) {
|
|||
let {audioDevices: audioDevices, videoDevices: videoDevices,
|
||||
sharingScreen: sharingScreen, sharingAudio: sharingAudio,
|
||||
requestTypes: requestTypes} = aRequest;
|
||||
let uri = Services.io.newURI(aRequest.documentURI, null, null);
|
||||
let uri;
|
||||
try {
|
||||
// This fails for principals that serialize to "null", e.g. file URIs.
|
||||
uri = Services.io.newURI(aRequest.origin, null, null);
|
||||
} catch (e) {
|
||||
uri = Services.io.newURI(aRequest.documentURI, null, null);
|
||||
}
|
||||
let host = getHost(uri);
|
||||
let chromeDoc = aBrowser.ownerDocument;
|
||||
let chromeWin = chromeDoc.defaultView;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue