|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 自动无缝翻页 |
3 | | -// @version 2.0.9 |
| 3 | +// @version 2.1.0 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、异次元软件、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork(以上仅一部分,更多的写不下了... |
6 | 6 | // @match *://*/* |
|
27 | 27 | var menuAll = [ |
28 | 28 | ['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []], |
29 | 29 | ['menu_discuz_thread_page', '帖子内自动翻页 (仅论坛)', '帖子内自动翻页 (仅论坛)', true], |
30 | | - ['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', true], |
31 | | - ['menu_page_number', '显示当前页码 (左下角)', '显示当前页码 (左下角)', true] |
| 30 | + ['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false], |
| 31 | + ['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true] |
32 | 32 | ], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, SiteType, pausePage = true, pageNum = {now: 1, _now: 1}, forumWebsite = ['cs.rin.ru', 'www.flyert.com', 'bbs.pediy.com']; |
33 | 33 | for (let i=0;i<menuAll.length;i++){ // 如果读取到的值为 null 就写入默认值 |
34 | 34 | if (GM_getValue(menuAll[i][0]) == null){GM_setValue(menuAll[i][0], menuAll[i][3])}; |
|
2896 | 2896 | } |
2897 | 2897 | // 插入网页 |
2898 | 2898 | let _html = `<style>#Autopage_number {top: calc(75vh) !important;left: 0 !important;width: 32px;height: 32px;padding: 6px !important;display: flex;position: fixed !important;opacity: 0.5;transition: .2s;z-index: 1000 !important;cursor: pointer;user-select: none !important;flex-direction: column;align-items: center;justify-content: center;box-sizing: content-box;border-radius: 0 50% 50% 0;transform-origin: center !important;transform: translateX(-8px);background-color: #eeec;-webkit-tap-highlight-color: transparent;box-shadow: 1px 1px 3px 0px #989898 !important;color: #000 !important;} #Autopage_number:hover {opacity: 1;transform: translateX(0);}</style> |
2899 | | -<div id="Autopage_number" title="当前页码 (可在 [自动无缝翻页] 脚本菜单中关闭)">${pageNum._now}</div>` |
| 2899 | +<div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭) 2. 鼠标左键点击此处 [临时暂停本页自动无缝翻页](再次点击可恢复)">${pageNum._now}</div>` |
2900 | 2900 | document.body.insertAdjacentHTML('beforeend', _html); |
| 2901 | + // 点击事件(临时暂停翻页) |
| 2902 | + document.getElementById('Autopage_number').onclick = function () { |
| 2903 | + if (pausePage) {pausePage = false; GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次点击可恢复)`, timeout: 2500});} else {pausePage = true; GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次点击可暂停)`, timeout: 2500});} |
| 2904 | + }; |
2901 | 2905 | status = document.getElementById('Autopage_number'); |
2902 | 2906 | set(); |
2903 | 2907 | } |
|
0 commit comments