storage.js: Use substring instead of startsWith on strings

IE11 doesn't support startsWith..
This commit is contained in:
Johannes Meyer 2019-07-15 13:31:55 +02:00
parent f11de266f4
commit 2280551484
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@
*/
window.addEventListener('storage', function(event) {
var url = icinga.utils.parseUrl(event.url);
if (! url.path.startsWith(icinga.config.baseUrl)) {
if (! url.path.substring(0, icinga.config.baseUrl.length) === icinga.config.baseUrl) {
// A localStorage is shared between all paths on the same origin.
// So we need to make sure it's us who made a change.
return;