@thepassle/app-tools 0.8.7 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/router/index.js +4 -2
package/package.json
CHANGED
package/router/index.js
CHANGED
|
@@ -126,6 +126,7 @@ export class Router extends EventTarget {
|
|
|
126
126
|
const url = new URL(a.href);
|
|
127
127
|
|
|
128
128
|
if (this.url.href === url.href) return;
|
|
129
|
+
if (url.host !== window.location.host) return;
|
|
129
130
|
if (a.hasAttribute('download') || a.href.includes('mailto:')) return;
|
|
130
131
|
|
|
131
132
|
const target = a.getAttribute('target');
|
|
@@ -141,7 +142,8 @@ export class Router extends EventTarget {
|
|
|
141
142
|
async navigate(url) {
|
|
142
143
|
if (typeof url === 'string') {
|
|
143
144
|
url = new URL(url, this.baseUrl);
|
|
144
|
-
}
|
|
145
|
+
}
|
|
146
|
+
|
|
145
147
|
this.route = this._matchRoute(url) || this._matchRoute(this.fallback);
|
|
146
148
|
log(`Navigating to ${url.pathname}${url.search}`, { context: this.context, route: this.route });
|
|
147
149
|
|
|
@@ -194,4 +196,4 @@ export class Router extends EventTarget {
|
|
|
194
196
|
}
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
}
|
|
199
|
+
}
|