Skip to content

Commit

Permalink
🎨 Improve clipping articles of WeChat media platform siyuan-note/siyu…
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 6, 2025
1 parent be5d49a commit 0937e94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions lib/Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -2125,27 +2125,29 @@ Readability.prototype = {
},

_cleanWeixinMp: function (e) {
// 改进微信公众号文章剪藏 Improve clipping articles of WeChat media platform https://github.com/siyuan-note/siyuan/issues/13733
if (0 > this._doc.baseURI.indexOf("mp.weixin.qq.com")) {
return;
}

var mp_profile_iframe_wrp = e.querySelector(".mp_profile_iframe_wrp");
if (!mp_profile_iframe_wrp) {
return;
}

var unlinks = [];
for (var n = mp_profile_iframe_wrp; n; n = n.nextSibling) {
unlinks.push(n);
var mp_profile_iframe_wrp = e.querySelector(".mp_profile_iframe_wrp");
if (mp_profile_iframe_wrp) {
unlinks.push(mp_profile_iframe_wrp);
if (mp_profile_iframe_wrp.previousElementSibling) {
for (var n = mp_profile_iframe_wrp; n; n = n.nextSibling) {
unlinks.push(n);
}
}
}

var content_bottom_area = e.querySelector("#content_bottom_area");
if (content_bottom_area) {
for (var n = content_bottom_area; n; n = n.nextSibling) {
unlinks.push(n);
}
}


for (var i = 0; i < unlinks.length; i++) {
unlinks[i].remove();
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
"name": "__MSG_extension_name__",
"options_page": "options.html",
"description": "__MSG_extension_description__",
"version": "1.8.2"
"version": "1.8.3"
}

0 comments on commit 0937e94

Please sign in to comment.