SecurityError when Storage access is denied
Created by: blacktrash
Happens for instance when an iframe wants to access window.localStorage
.
Instead return false
in DOMStorage.js isSupported()
:
diff --git a/src/streaming/utils/DOMStorage.js b/src/streaming/utils/DOMStorage.js
index e147e9c..b7260e7 100644
--- a/src/streaming/utils/DOMStorage.js
+++ b/src/streaming/utils/DOMStorage.js
@@ -73,11 +73,15 @@ MediaPlayer.utils.DOMStorage = function () {
},
//type can be local, session
isSupported: function(type) {
- if (type === MediaPlayer.utils.DOMStorage.STORAGE_TYPE_LOCAL) {
- return window.localStorage || false;
- } else if (type === MediaPlayer.utils.DOMStorage.STORAGE_TYPE_SESSION) {
- return window.sessionStorage || false;
- } else {
+ try {
+ if (type === MediaPlayer.utils.DOMStorage.STORAGE_TYPE_LOCAL) {
+ return window.localStorage || false;
+ } else if (type === MediaPlayer.utils.DOMStorage.STORAGE_TYPE_SESSION) {
+ return window.sessionStorage || false;
+ } else {
+ return false;
+ }
+ } catch (e) {
return false;
}
}