Skip to content

Commit

Permalink
Fix webpage title
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Oct 17, 2020
1 parent 2a6b214 commit 4f6bfda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const telegram = async (telegram: Types['telegram']): Promise<Archived[]>
const doc = new JSDOM(webpage, { virtualConsole }).window.document;
archived.push({
id: msgid,
url: pageURL(doc),
url: pageURL(doc) || uri,
title: pageTitle(doc),
content: webpage,
success: success,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const pageURL = (doc: Document): string => {
}
}

return doc.URL;
return doc.URL === 'about:blank' ? '' : doc.URL;
};

export const pageTitle = (doc: Document): string => {
Expand Down

0 comments on commit 4f6bfda

Please sign in to comment.