mirror of https://github.com/OpenVidu/openvidu.git
Merge pull request #816 from semmel/semmel-inaccessible-localStorage
Tolerate inaccessible localStoragepull/819/head
commit
2f2001490a
|
@ -121,7 +121,13 @@ export class WebRtcStats {
|
||||||
}
|
}
|
||||||
|
|
||||||
public initWebRtcStats(): void {
|
public initWebRtcStats(): void {
|
||||||
const webrtcObj = localStorage.getItem(this.STATS_ITEM_NAME);
|
let webrtcObj = null;
|
||||||
|
// When cross-site (aka third-party) cookies are blocked by the browser,
|
||||||
|
// accessing localStorage in a third-party iframe throws a DOMException.
|
||||||
|
try {
|
||||||
|
webrtcObj = localStorage.getItem(this.STATS_ITEM_NAME);
|
||||||
|
}
|
||||||
|
catch(e){}
|
||||||
|
|
||||||
if (!!webrtcObj) {
|
if (!!webrtcObj) {
|
||||||
this.webRtcStatsEnabled = true;
|
this.webRtcStatsEnabled = true;
|
||||||
|
|
Loading…
Reference in New Issue