mirror of
https://github.com/SoPat712/Speeder.git
synced 2026-10-08 11:05:02 -04:00
chore: refresh release and test tooling
This commit is contained in:
11 files changed
+206
-252
No files matched your search
@@ -4,6 +4,7 @@ const { JSDOM } = require("jsdom");
|
||||
const vi = globalThis.vi;
|
||||
|
||||
const ROOT = path.resolve(__dirname, "..", "..");
|
||||
let activeDom = null;
|
||||
|
||||
function clone(value) {
|
||||
if (value === undefined) return undefined;
|
||||
@@ -47,11 +48,13 @@ function applyJSDOMWindow(win) {
|
||||
|
||||
function loadHtmlString(html, options) {
|
||||
const config = options || {};
|
||||
if (activeDom) activeDom.window.close();
|
||||
const dom = new JSDOM(html, {
|
||||
url: config.url || "https://example.org/",
|
||||
pretendToBeVisual: true,
|
||||
runScripts: "dangerously"
|
||||
});
|
||||
activeDom = dom;
|
||||
applyJSDOMWindow(dom.window);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user