Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

hexo-server-live

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-server-live - npm Package Compare versions

Comparing version
0.2.7
to
0.2.8
+4
-0
CHANGELOG.md

@@ -0,1 +1,5 @@

## v0.2.8 (2024-01-16)
- Improvement: replace all stylesheets when the path does not match.
## v0.2.7 (2024-01-16)

@@ -2,0 +6,0 @@

+15
-10

@@ -19,13 +19,18 @@ module.exports = function({

if (data.type === "style") {
const links = document.querySelectorAll("link");
for (const link of links) {
const url = new URL(link.href);
if (url.host === location.host && url.pathname === data.path) {
const next = link.cloneNode();
next.href = data.path + "?" + Math.random().toString(36).slice(2);
next.onload = () => link.remove();
link.parentNode.insertBefore(next, link.nextSibling);
return;
const links = document.querySelectorAll("link[rel=stylesheet]");
let fallback = false;
do {
for (const link of links) {
const url = new URL(link.href);
if (url.host === location.host && (fallback || url.pathname === data.path)) {
const next = link.cloneNode();
next.href = url.pathname + "?" + Math.random().toString(36).slice(2);
next.onload = () => link.remove();
link.parentNode.insertBefore(next, link.nextSibling);
if (!fallback) return;
}
}
}
if (fallback) return;
} while (fallback = true);
}

@@ -32,0 +37,0 @@

{
"name": "hexo-server-live",
"version": "0.2.7",
"version": "0.2.8",
"description": "Live reload while source file changed for Hexo.",

@@ -5,0 +5,0 @@ "main": "index",