Hotfix: jianshu img (#1259)

修复简书无法显示图片的问题
This commit is contained in:
凉凉 2018-12-11 11:31:38 +08:00 committed by DIYgod
parent f84cd9bb77
commit 02ff8826c3
1 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,15 @@ async function load(link) {
const serverOffset = date.getTimezoneOffset() / 60;
const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString();
// 还原图片地址
$('img').each((index, elem) => {
const $elem = $(elem);
const src = $elem.attr('data-original-src');
if (src && src !== '') {
$elem.attr('src', `https:${src}`);
}
$elem.attr('referrerpolicy', 'no-referrer');
});
// 提取内容
const description = $('.show-content-free').html();