fix(local-storage) use local storage on WebKit when not in an iframe
There should be no need to use the workaround when visiting the site normally.
This commit is contained in:
parent
248865ad3f
commit
11382cfda6
|
@ -11,6 +11,20 @@ import logger from './logger';
|
||||||
declare var APP: Object;
|
declare var APP: Object;
|
||||||
declare var config: Object;
|
declare var config: Object;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether we are loaded in an iframe.
|
||||||
|
*
|
||||||
|
* @returns {boolean} Returns {@code true} if loaded in iframe.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function _inIframe() {
|
||||||
|
try {
|
||||||
|
return window.self !== window.top;
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles changes of the fake local storage.
|
* Handles changes of the fake local storage.
|
||||||
*
|
*
|
||||||
|
@ -41,7 +55,9 @@ function shouldUseHostPageLocalStorage(urlParams) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.isWebKitBased()) { // Webkit browsers don't persist local storage for third-party iframes.
|
if (browser.isWebKitBased() && _inIframe()) {
|
||||||
|
// WebKit browsers don't persist local storage for third-party iframes.
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue