diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-18 10:56:28 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-18 10:56:28 +0100 |
commit | 912aa47acf658ae26ac24bb3f6ca52b04919f2ee (patch) | |
tree | fd551c51c78df5ab60db9c97d2e5deb90aa4ff75 /browser/modules/webrtcUI.jsm | |
parent | a24511ca8e19afe4d19008ba903e1edab0af3223 (diff) | |
parent | ea1b2e81e4c092a3b871bed49e907fba20483bdc (diff) | |
download | uxp-912aa47acf658ae26ac24bb3f6ca52b04919f2ee.tar.gz |
Merge branch 'ported-upstream'
Diffstat (limited to 'browser/modules/webrtcUI.jsm')
-rw-r--r-- | browser/modules/webrtcUI.jsm | 8 |
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; |