Skip to content

Commit 6929ca9

Browse files
committed
优化 [动漫屋]、[Mangabz 漫画] 规则; 优化 xhr 代码
1 parent 8760d25 commit 6929ca9

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

Autopage.user.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 自动无缝翻页
44
// @name:zh-TW 自動無縫翻頁
55
// @name:en AutoPager
6-
// @version 6.0.5
6+
// @version 6.0.6
77
// @author X.I.U
88
// @description ⭐无缝加载 下一页内容 至网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、B 站(bilibili)、NGA、V2EX、煎蛋网、龙的天空、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
99
// @description:zh-TW ⭐無縫加載 下一頁內容 至網頁底部(類似瀑布流)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~
@@ -978,11 +978,11 @@ function: {
978978
} else if (getCSS('.detail-more')) {
979979
getCSS('.detail-more').click();
980980
}},
981-
style: '.view-paging > .container, .view-comment {display: none !important;} .rightToolBar {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important; max-width: 99% !important; width: auto !important; height: auto !important;} body {overflow: auto !important;}',
981+
style: '.view-paging > .container, .view-comment {display: none !important;} .rightToolBar {opacity: 0.3 !important;} #cp_img > img, #barChapter > img{display: block !important;margin: 0 auto !important; max-width: 99% !important; width: auto !important; height: auto !important;} body {overflow: auto !important;}',
982982
pager: {
983983
type: 4,
984984
nextL: dm5_nextL,
985-
insertP: ['#cp_img', 3],
985+
insertP: ['#barChapter,#cp_img', 3],
986986
insertE: dm5_insertE,
987987
replaceE: '.view-paging > .container, .rightToolBar',
988988
interval: 500,
@@ -1583,15 +1583,13 @@ function: {
15831583

15841584
// [Mangabz 漫画] 初始化(调整本话图片)
15851585
function mangabz_init() {
1586-
let showimage = getCSS('#showimage'),
1587-
cp_img = getCSS('#cp_img'),
1588-
cp_image = getCSS('#cp_image');
1589-
if (showimage) {showimage.removeAttribute('oncontextmenu');}
1590-
if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
1591-
if (cp_image) {
1592-
cp_image.removeAttribute('oncontextmenu');
1593-
cp_image.removeAttribute('id');
1594-
cp_image.removeAttribute('style');
1586+
if (getCSS('#showimage')) getCSS('#showimage').removeAttribute('oncontextmenu');
1587+
if (getCSS('#cp_img')) getCSS('#cp_img').removeAttribute('oncontextmenu');
1588+
if (getCSS('#barChapter')) getCSS('#barChapter').removeAttribute('oncontextmenu');
1589+
if (getCSS('#cp_image')) {
1590+
getCSS('#cp_image').removeAttribute('oncontextmenu');
1591+
getCSS('#cp_image').removeAttribute('id');
1592+
getCSS('#cp_image').removeAttribute('style');
15951593
}
15961594
}
15971595
// [Mangabz 漫画] 获取下一页地址
@@ -1661,7 +1659,7 @@ function: {
16611659
}
16621660
} else { // 下一话
16631661
// 插入 <script> 标签
1664-
insScript('html:not([dir]) > head > script:not([src])', pageE);
1662+
insScript('html:not([dir])>head>script:not([src])', pageE);
16651663
addHistory(pageE);
16661664
pageNum.now = pageNum._now + 1
16671665
replaceElems(pageE)
@@ -1834,7 +1832,8 @@ function: {
18341832
overrideMimeType: 'text/html; charset=' + (document.characterSet||document.charset||document.inputEncoding),
18351833
headers: {
18361834
'Referer': (curSite.noReferer === true) ? '':location.href,
1837-
'User-Agent': navigator.userAgent
1835+
'User-Agent': navigator.userAgent,
1836+
'Accept': 'text/html,application/xhtml+xml,application/xml'
18381837
},
18391838
timeout: 10000,
18401839
onload: function (response) {
@@ -1858,14 +1857,14 @@ function: {
18581857
}
18591858
// 翻页类型 4
18601859
function getPageE_(url, type = '', method = 'GET', data = '', type2) {
1861-
let mimeType;
1860+
let mimeType,accept;
18621861
switch (type) {
18631862
case 'json':
1864-
mimeType = 'application/json; charset=' + (document.characterSet||document.charset||document.inputEncoding); break;
1863+
accept = 'application/json'; mimeType = 'application/json; charset=' + (document.characterSet||document.charset||document.inputEncoding); break;
18651864
case 'text':
1866-
mimeType = 'text/plain; charset=' + (document.characterSet||document.charset||document.inputEncoding); break;
1865+
accept = 'text/plain'; mimeType = 'text/plain; charset=' + (document.characterSet||document.charset||document.inputEncoding); break;
18671866
default:
1868-
mimeType = 'text/html; charset=' + (document.characterSet||document.charset||document.inputEncoding);
1867+
accept = 'text/html,application/xhtml+xml,application/xml'; mimeType = 'text/html; charset=' + (document.characterSet||document.charset||document.inputEncoding);
18691868
}
18701869

18711870
GM_xmlhttpRequest({
@@ -1877,7 +1876,8 @@ function: {
18771876
headers: {
18781877
'Referer': (curSite.noReferer === true) ? '':location.href,
18791878
'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':'',
1880-
'User-Agent': navigator.userAgent
1879+
'User-Agent': navigator.userAgent,
1880+
'Accept': accept
18811881
},
18821882
timeout: 10000,
18831883
onload: function (response) {

0 commit comments

Comments
 (0)