From 9ac97a329359f6b7332c867892617d9287442ec8 Mon Sep 17 00:00:00 2001 From: Snir David Date: Sat, 22 Aug 2020 12:22:29 +0300 Subject: [PATCH] Collect urls in pushstate the same way as in initial load --- public/umami.js | 2 +- tracker/index.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/umami.js b/public/umami.js index 3bf2dec5..781d1f10 100644 --- a/public/umami.js +++ b/public/umami.js @@ -1 +1 @@ -!function(){"use strict";function e(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}var t=setTimeout;function n(e){return Boolean(e&&void 0!==e.length)}function r(){}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}a(t.promise,r)}else(1===e._state?a:u)(t.promise,e._value)}))):e._deferreds.push(t)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void f((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}var r,i}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t { + const handlePush = (state, title, navaigatedUrl) => { removeEvents(); currentRef = currentUrl; - currentUrl = url; + const url = new URL(navaigatedUrl); + currentUrl = `${url.pathname}${url.search}`; pageView(); };