Bug #8063 Safari crash in private browsing mode

Catch the crash and display a more useful error message to the user
about a work around.
This commit is contained in:
Stacey-Gammon 2016-09-16 15:15:43 -04:00
parent 84a504ecf0
commit 7dbb786dcd

View file

@ -8,6 +8,17 @@ module.exports = function (chrome, internals) {
}
internals.appUrlStore = internals.appUrlStore || window.sessionStorage;
try {
const verifySessionStorage = 'verify sessionStorage';
internals.appUrlStore.setItem(verifySessionStorage, 1);
internals.appUrlStore.removeItem(verifySessionStorage);
} catch (error) {
throw new Error(
'Kibana requires access to sessionStorage, and it looks like ' +
'your browser isn\'t providing access to sessionStorage. If you\'re ' +
'using Safari with private browsing enabled, you can solve this ' +
'problem by disabling private browsing, or by using another browser.');
}
/**
* ui/chrome apps API
@ -50,6 +61,4 @@ module.exports = function (chrome, internals) {
chrome.setLastUrlFor = function (appId, url) {
internals.appUrlStore.setItem(`appLastUrl:${appId}`, url);
};
};