From fc7a2f35162ace65ab91be2fcbdb12a07be36dd5 Mon Sep 17 00:00:00 2001 From: gantrol Date: Wed, 15 Feb 2023 23:10:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=9E=E5=A4=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=97=B6=EF=BC=8C=E5=AF=BC=E5=87=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?JSON=E5=BC=95=E7=94=A8=E7=BC=BA=E5=B0=91tabindex=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uitls/bingPage.ts | 2 ++ uitls/visitor.ts | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/uitls/bingPage.ts b/uitls/bingPage.ts index 0f16c6d..f836779 100644 --- a/uitls/bingPage.ts +++ b/uitls/bingPage.ts @@ -25,6 +25,7 @@ export class Page { static handleRefs = (ansFrame: HTMLElement, setFontWeight=true, returnJSON=false) => { // ansFrame's css selector is cib-message[type="text"] + if (ansFrame === null) return; const refsBlock = ansFrame .shadowRoot .querySelector("cib-message-attributions"); @@ -37,6 +38,7 @@ export class Page { } if (returnJSON) { return { + index: linkElm.getAttribute("tabindex"), title: linkElm.getAttribute("title"), href: linkElm.getAttribute("href") }; diff --git a/uitls/visitor.ts b/uitls/visitor.ts index 97591ce..bdd1116 100644 --- a/uitls/visitor.ts +++ b/uitls/visitor.ts @@ -50,7 +50,6 @@ export class DownloadVisitor { static forJSON = () => { const result = Page.getQAsJSON(); - console.log(result); const dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(result)); const downloadAnchorNode = document.createElement('a'); downloadAnchorNode.setAttribute("href", dataStr);