summaryrefslogtreecommitdiff
path: root/browser/modules/webrtcUI.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'browser/modules/webrtcUI.jsm')
-rw-r--r--browser/modules/webrtcUI.jsm8
1 files changed, 7 insertions, 1 deletions
diff --git a/browser/modules/webrtcUI.jsm b/browser/modules/webrtcUI.jsm
index b24135bfc9..08de46bb34 100644
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -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;