Merge pull request #1745 from omnivore-app/fix/save-wrong-title

Fix incorrect title on page hosted on notion.site
This commit is contained in:
Hongbo Wu 2023-01-31 09:20:27 +08:00 committed by GitHub
commit 4ed6adba41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@
function getDocumentTitle () {
const opengraphTitleEl = document.querySelector(SELECTORS.TITLE);
const openGraphTitle = opengraphTitleEl && opengraphTitleEl.content;
return openGraphTitle || document.title || '';
return document.title || openGraphTitle || '';
}
function getCanonicalUrl () {