elegance-js 2.1.28 → 2.1.30
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/dist/client/runtime.js +12 -10
- package/dist/components/Link.js +1 -2
- package/package.json +1 -1
package/dist/client/runtime.js
CHANGED
|
@@ -429,16 +429,18 @@ const fetchPage = async (targetURL) => {
|
|
|
429
429
|
// get page script
|
|
430
430
|
{
|
|
431
431
|
const pageDataScript = newDOM.querySelector(`script[data-hook="true"][data-pathname="${pathname}"]`);
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
432
|
+
if (pageDataScript) {
|
|
433
|
+
const text = pageDataScript.textContent;
|
|
434
|
+
pageDataScript.remove();
|
|
435
|
+
const blob = new Blob([text], { type: 'text/javascript' });
|
|
436
|
+
const url = URL.createObjectURL(blob);
|
|
437
|
+
const script = document.createElement("script");
|
|
438
|
+
script.src = url;
|
|
439
|
+
script.type = "module";
|
|
440
|
+
script.setAttribute("data-page", "true");
|
|
441
|
+
script.setAttribute("data-pathname", `${pathname}`);
|
|
442
|
+
newDOM.head.appendChild(script);
|
|
443
|
+
}
|
|
442
444
|
}
|
|
443
445
|
pageStringCache.set(pathname, xmlSerializer.serializeToString(newDOM));
|
|
444
446
|
return newDOM;
|
package/dist/components/Link.js
CHANGED
|
@@ -4,8 +4,7 @@ function Link(options, ...children) {
|
|
|
4
4
|
const handler = eventListener((event) => {
|
|
5
5
|
const targetUrl = new URL(event.currentTarget.href, window.location.href);
|
|
6
6
|
const currentUrl = new URL(window.location.href);
|
|
7
|
-
const isSameHost = targetUrl.
|
|
8
|
-
targetUrl.port === currentUrl.port;
|
|
7
|
+
const isSameHost = targetUrl.host === currentUrl.host;
|
|
9
8
|
if (!isSameHost) {
|
|
10
9
|
return;
|
|
11
10
|
}
|