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);