Răsfoiți Sursa

fix: don't load changelog via resource directive anymore

Sv443 4 luni în urmă
părinte
comite
cdc41086ec
2 a modificat fișierele cu 4 adăugiri și 2 ștergeri
  1. 2 0
      src/constants.ts
  2. 2 2
      src/utils/misc.ts

+ 2 - 0
src/constants.ts

@@ -18,6 +18,8 @@ export const host = (hostRaw.match(/^#{{.+}}$/) ? "github" : hostRaw) as "github
 /** The build number of the userscript */
 export const buildNumber = (buildNumberRaw.match(/^#{{.+}}$/) ? "BUILD_ERROR!" : buildNumberRaw) as string; // asserted as generic string instead of literal
 
+export const changelogUrl = `https://raw.githubusercontent.com/${repo}/${branch}/changelog.md`;
+
 /** The URL search parameters at the earliest possible time */
 export const initialParams = new URL(location.href).searchParams;
 

+ 2 - 2
src/utils/misc.ts

@@ -1,6 +1,6 @@
 import { compress, decompress, fetchAdvanced, getUnsafeWindow, openInNewTab, pauseFor, randomId, randRange, type Prettify } from "@sv443-network/userutils";
 import { marked } from "marked";
-import { branch, compressionFormat, repo, sessionStorageAvailable } from "../constants.js";
+import { branch, changelogUrl, compressionFormat, repo, sessionStorageAvailable } from "../constants.js";
 import { type Domain, type NumberLengthFormat, type ResourceKey, type StringGen } from "../types.js";
 import { error, type TrLocale, warn, sendRequest, getLocale, log, getVideoElement, getVideoTime } from "./index.js";
 import { enableDiscardBeforeUnload } from "../features/behavior.js";
@@ -342,7 +342,7 @@ export function parseMarkdown(mdString: string) {
 
 /** Returns the content of the changelog markdown file */
 export async function getChangelogMd() {
-  const clRes = await fetchAdvanced(await getResourceUrl("doc-changelog", true));
+  const clRes = await fetchAdvanced(changelogUrl);
   log("Fetched changelog:", clRes);
   return await clRes.text();
 }