Skip to content

Commit

Permalink
Merge pull request elastic#8344 from elastic/jasper/backport/8343/5.x
Browse files Browse the repository at this point in the history
[backport] PR elastic#8343 to 5.x - Report useful error message when sessionStorage is unavailable
  • Loading branch information
stacey-gammon authored Sep 19, 2016
2 parents 97960b0 + ddd1d7e commit 3fc16ef
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ui/public/chrome/api/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 is restricting it. 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
Expand Down Expand Up @@ -50,6 +61,4 @@ module.exports = function (chrome, internals) {
chrome.setLastUrlFor = function (appId, url) {
internals.appUrlStore.setItem(`appLastUrl:${appId}`, url);
};


};

0 comments on commit 3fc16ef

Please sign in to comment.