nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit 72988c47fc8c8420b0bdffcd64651e9b4389bb1a
parent fedc929a1f08649304535a01f52c21bfe8f2e02a
Author: Sergey Orlov <wladimirych@gmail.com>
Date:   Thu, 18 Feb 2021 21:59:41 +0100

hashState: do not update address if it has not changed

layers add/remove can produce many hash state events which triggers
error "The operation is insecure" in Firefox

Diffstat:
Msrc/lib/leaflet.hashState/hashState.js | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/leaflet.hashState/hashState.js b/src/lib/leaflet.hashState/hashState.js @@ -77,7 +77,9 @@ const hashState = { const hash = stateItems.join('&'); const href = `${location.origin}${location.pathname}${location.search}#${hash}`; this._ignoreChanges = true; - location.replace(href); + if (href !== location.href) { + location.replace(href); + } this._ignoreChanges = false; },