Revert "storage.js: Use substring instead of startsWith on strings"

This reverts commit 22805514843424f9040ed92af86691a053d2c463.
This commit is contained in:
Sukhwinder Dhillon 2022-05-23 11:16:02 +02:00 committed by Johannes Meyer
parent 252f17e868
commit cf9ffe29bf

View File

@ -44,7 +44,7 @@
*/
window.addEventListener('storage', function(event) {
var url = icinga.utils.parseUrl(event.url);
if (! url.path.substring(0, icinga.config.baseUrl.length) === icinga.config.baseUrl) {
if (! url.path.startsWith(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;