diff --git a/src/excmds.ts b/src/excmds.ts index a6dea96c..cb1523d3 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -5991,16 +5991,12 @@ export async function extoptions(...optionNameArgs: string[]) { } //#content_helper -// { import { Readability } from "@mozilla/readability" -import xss from "xss" -// } //#content_helper export async function readerurl() { document.querySelectorAll(".TridactylStatusIndicator").forEach(ind => ind.parentNode.removeChild(ind)) const article = new Readability(document.cloneNode(true) as any as Document).parse() - article.content = xss(article.content, {stripIgnoreTag: true}) article["link"] = window.location.href return browser.runtime.getURL("static/reader.html#" + btoa(encodeURIComponent(JSON.stringify(article)))) } diff --git a/src/reader.ts b/src/reader.ts index 649aaccb..3a8d6932 100644 --- a/src/reader.ts +++ b/src/reader.ts @@ -1,7 +1,9 @@ // import * as config from "@src/lib/config" +import xss from "xss" function updatePage(){ const article = JSON.parse(decodeURIComponent(atob(window.location.hash.substr(1)))) + article.content = xss(article.content, {stripIgnoreTag: true}) document.body.innerHTML = article.content if (article.title !== undefined) { const header = document.createElement("header")