fix(extension): harden controls, rules, and speed persistence

This commit is contained in:
joshpatra committed 2026-07-16 01:31:57 -04:00
1 parent cd3088a6db
commit 85d4a0588a
29 files changed
+6154 -842

No files matched your search

+2 -2
View File
@@ -17,9 +17,9 @@ function readRepoFile(relPath) {
* Parse HTML into a fresh JSDOM document so tests can reload scripts without
* top-level `const` redeclaration errors (avoids document.write).
*/
export function loadHtmlString(html) {
export function loadHtmlString(html, options = {}) {
const dom = new JSDOM(html, {
url: "https://example.org/",
url: options.url || "https://example.org/",
pretendToBeVisual: true,
runScripts: "dangerously"
});
+3 -2
View File
@@ -44,9 +44,10 @@ function applyJSDOMWindow(win) {
win.close = vi.fn();
}
function loadHtmlString(html) {
function loadHtmlString(html, options) {
const config = options || {};
const dom = new JSDOM(html, {
url: "https://example.org/",
url: config.url || "https://example.org/",
pretendToBeVisual: true,
runScripts: "dangerously"
});