From fc338c8958a22cf67775daafbe688c7591c0baf6 Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Wed, 5 May 2021 16:17:34 -0500 Subject: [PATCH] Use removeSheet() --- srcts/src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srcts/src/main.ts b/srcts/src/main.ts index cc343b62e..5de6e85fd 100644 --- a/srcts/src/main.ts +++ b/srcts/src/main.ts @@ -4077,6 +4077,8 @@ function main(): void { return null; }; + // Removes the stylesheet from document.styleSheets, and also removes + // the owning element, if present. let removeSheet = function (sheet) { if (!sheet) return; sheet.disabled = true; @@ -4088,6 +4090,7 @@ function main(): void { // Find any document.styleSheets that match this link's href // so we can remove it after bringing in the new stylesheet const oldSheet = findSheet(link.attr("href")); + // Add a timestamp to the href to prevent caching const href = link.attr("href") + "?restyle=" + new Date().getTime(); // Use inline