remove the code to get create_time from wechat article in browser runtime

This commit is contained in:
Hongbo Wu
2023-07-11 16:20:08 +08:00
parent 1f283e6122
commit fd67baea09
2 changed files with 2 additions and 22 deletions

View File

@ -761,15 +761,7 @@ async function retrieveHtml(page, logRecord) {
document.getElementById('px-block-form-wrapper')) {
return 'IS_BLOCKED'
}
// check if create_time is defined
if (typeof create_time !== 'undefined' && create_time) {
// create_time is a global variable set by WeChat when rendering the page
const date = new Date(create_time * 1000);
const dateNode = document.createElement('div');
dateNode.className = 'omnivore-published-date';
dateNode.innerHTML = date.toLocaleString();
document.body.appendChild(dateNode);
}
return document.documentElement.outerHTML;
}, iframes);
logRecord.puppeteerSuccess = true;

View File

@ -136,19 +136,7 @@
document.documentElement.appendChild(contentCopyEl);
Array.from(contentCopyEl.getElementsByTagName('*')).forEach(prepareContentPostItem);
try {
// check if create_time is defined
if (typeof create_time !== 'undefined' && create_time) {
// create_time is a global variable set by WeChat when rendering the page
const date = new Date(create_time * 1000);
const dateNode = document.createElement('div');
dateNode.className = 'omnivore-published-date';
dateNode.innerHTML = date.toLocaleString();
contentCopyEl.appendChild(dateNode);
}
} catch (e) {
console.log('Error while trying to add published date to WeChat post', e);
}
/*
* Grab head and body separately as using clone on entire document into a div
* removes the head and body tags while grabbing html in them. Instead we