From 1d977875bee1eade9424f8cc48bd33604c7c269d Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sat, 22 Aug 2020 19:59:39 -0700 Subject: [PATCH] Fix tracker bug. --- package.json | 2 +- public/umami.js | 2 +- tracker/index.js | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b857f3a6..8aced06d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "0.15.0", + "version": "0.15.1", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", diff --git a/public/umami.js b/public/umami.js index c46c7566..e486dbf0 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 { removeEvents(); currentRef = currentUrl; - const url = new URL(navaigatedUrl); - currentUrl = `${url.pathname}${url.search}`; + + if (navaigatedUrl.startsWith('http')) { + const url = new URL(navaigatedUrl); + currentUrl = `${url.pathname}${url.search}`; + } else { + currentUrl = navaigatedUrl; + } + pageView(); };