├── Baidu-Search-Font-Size++ └── user.css ├── Chrome-Scrollbar-Beautify └── user.css ├── Disable-SendBeacon └── user.js ├── Douban-Book-to-UJS-Library └── user.js ├── FT-Auto-Full-Article └── user.js ├── GitHub-File-History └── user.js ├── GitHub-Star-History └── user.js ├── Qireader-Keymap └── user.js ├── RSS-to-Clipboard └── user.js ├── RSS-to-Inoreader └── user.js ├── Rename-Zhuhu-Daily-Title └── user.js ├── Video-Auto-Fullscreen └── user.js └── readme.md /Baidu-Search-Font-Size++/user.css: -------------------------------------------------------------------------------- 1 | .t { 2 | font-size: 18px; 3 | } 4 | 5 | .c-abstract { 6 | font-size: 15px; 7 | } -------------------------------------------------------------------------------- /Chrome-Scrollbar-Beautify/user.css: -------------------------------------------------------------------------------- 1 | ::-webkit-scrollbar { 2 | width: 7px; 3 | height: 7px; 4 | } 5 | 6 | ::-webkit-scrollbar-thumb:vertical { 7 | background-color: #CCC; 8 | -webkit-border-radius: 6px; 9 | } 10 | 11 | ::-webkit-scrollbar-thumb:horizontal { 12 | background-color: #CCC; 13 | -webkit-border-radius: 6px; 14 | } 15 | 16 | ::-webkit-scrollbar-thumb:active { 17 | background-color: #666; 18 | } -------------------------------------------------------------------------------- /Disable-SendBeacon/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 禁用sendBeacon 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 0.2 6 | // @description 禁用navigator.sendBeacon 7 | // @author tmr 8 | // @include http://* 9 | // @include https://* 10 | // @grant none 11 | // ==/UserScript== 12 | 13 | (function () { 14 | 'use strict'; 15 | navigator.sendBeacon = function (url, data) { 16 | // console.log('fake sendBeacon: ', url, data); 17 | return true; 18 | }; 19 | })(); 20 | -------------------------------------------------------------------------------- /Douban-Book-to-UJS-Library/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 豆瓣读书直达江苏大学图书馆搜索 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 0.3 6 | // @description 豆瓣读书直达江苏大学图书馆搜索,方便找书 7 | // @author tmr 8 | // @include https://book.douban.com/* 9 | // @grant none 10 | // ==/UserScript== 11 | 12 | (function () { 13 | 'use strict'; 14 | let title = document.getElementsByTagName('h1')[0].children[0].innerText; 15 | let info = document.getElementById('info'); 16 | let liblink = document.createElement('a'); 17 | let isbn = info.innerText.match(/\d{13}|\d{10}/)[0]; 18 | liblink.href = 19 | 'http://huiwen.ujs.edu.cn:8080/opac/openlink.php?strSearchType=isbn&match_flag=full&historyCount=1&strText=' + 20 | isbn + 21 | '&doctype=ALL&with_ebook=on&displaypg=20&showmode=list&sort=CATA_DATE&orderby=desc&location=ALL'; 22 | liblink.target = '_blank'; 23 | liblink.innerText = '去江苏大学图书馆搜索'; 24 | info.appendChild(liblink); 25 | })(); 26 | -------------------------------------------------------------------------------- /FT-Auto-Full-Article/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name FT中文网自动加载全文 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 1.0 6 | // @description FT中文网自动加载全文,并修改所有FT中文网链接,增加全文参数 7 | // @author tmr 8 | // @match http://*/* 9 | // @match https://*/* 10 | // @grant none 11 | // ==/UserScript== 12 | 13 | (function () { 14 | "use strict"; 15 | function fullft(link) { 16 | try { 17 | let u = new URL(link); 18 | if ( 19 | (u.host == "chineseft.com" || 20 | u.host == "www.chineseft.com" || 21 | u.host == "ftchinese.com" || 22 | u.host == "www.ftchinese.com" || 23 | u.host == "m.ftchinese.com" || 24 | u.host == "cn.ft.com") && 25 | (u.pathname.startsWith("/story/") || 26 | u.pathname.startsWith("/premium/") || 27 | u.pathname.startsWith("/interactive/")) && 28 | u.searchParams.get("full") == null 29 | ) { 30 | u.searchParams.set("full", "y"); 31 | return u.toString(); 32 | } else { 33 | return false; 34 | } 35 | } catch (e) { 36 | console.error(e); 37 | return false; 38 | } 39 | } 40 | // 替换页面ft链接 41 | function replace(u) { 42 | let n = fullft(location.href); 43 | if (n) { 44 | location.href = n; 45 | return; 46 | } 47 | let aTagList = document.querySelectorAll("a"); 48 | aTagList.forEach(function (ele) { 49 | let n = fullft(ele.href); 50 | if (n) { 51 | ele.href = n; 52 | } 53 | }); 54 | } 55 | replace(); 56 | })(); 57 | -------------------------------------------------------------------------------- /GitHub-File-History/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name GitHub File History 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 0.6 6 | // @description GitHub File History 快速跳转到 https://github.githistory.xyz/ 7 | // @author tmr 8 | // @match https://github.com/*/* 9 | // @grant none 10 | // ==/UserScript== 11 | 12 | (async function () { 13 | "use strict"; 14 | let count = 0; 15 | function run() { 16 | if (document.readyState == "complete" && count > 5) { 17 | return; 18 | } 19 | count++; 20 | let n = document.querySelector("a[aria-label='History']"); 21 | if (n == null) { 22 | setTimeout(run, 500); 23 | return; 24 | } 25 | 26 | let cn = n.cloneNode(true); 27 | cn.lastChild.textContent = "Git History"; 28 | cn.href = cn.href.replace("github.com", "github.githistory.xyz"); 29 | n.parentElement.append(cn); 30 | } 31 | run(); 32 | })(); 33 | -------------------------------------------------------------------------------- /GitHub-Star-History/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name GitHub Star History 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 0.2 6 | // @description GitHub Star History 快速跳转到 https://star-history.com/ 7 | // @author tmr 8 | // @match https://github.com/*/* 9 | // @grant none 10 | // ==/UserScript== 11 | 12 | (function () { 13 | "use strict"; 14 | let paths = location.pathname.split("/"); 15 | if (paths.length < 3) { 16 | return; 17 | } 18 | let repo = paths[1] + "/" + paths[2]; 19 | 20 | let link = document.createElement("a"); 21 | link.href = "https://star-history.com/#" + repo; 22 | link.className = "btn btn-sm tooltipped tooltipped-s"; 23 | link.title = "Open Star History"; 24 | link.target = "_blank"; 25 | link.rel = "noopener noreferrer"; 26 | link.setAttribute("aria-label", "Open Star History"); 27 | 28 | let logo = document.createElement("img"); 29 | logo.src = 30 | "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAPcElEQVR42uWbbWxeZ3nHf9d1n/M8thPHSWqX0OaljQOEliYkcRLTqkUlAio61vKyAuJlb3QCaR8mTWjS9nnShIQ0aZrY1k4TiI2Ksq10QqKrQlnZWGI/TmlpYWE0Le3a0tioSUhi+3nOff/34T52nDROHNuhFdxS9Dj2ec65r/99Xf/r9cCv+bLXegOXvFr0NyvWTDc4xk7Gf30AaNHfFDci1uMUJl5xePL0bh5bym2L11quhazGKHekxLtkXOPOSsRKxJEIvbR4niEmfmUBKMe4W5FPBtgi6JHAoE/GgCA0xf9Nw4OLvb+/1gJecLXYSuQjBm+XcaVDH9AjmAIGTGyXGKZF/68kAF5xl8FWoMchCASYsuauxFhnxrayzeZfOQC6WtzqgZsw+rBM1gligojqi4wmcHXH6VvscxbOAcvsfi64DjGgyPsDDMpouvAEVYKTLoIZ3fWVDrM/Xz4AekbZ0YZ9ydgaEqd9hB91jDECzyw7GC36meb26GxzZ42LUlABJxP8pIA3yOgiAbZ0P35xAA4xoIpPu3gfzkAQmPGLMvFTM37ECPvbBQ8tBxBhlDtC4o5UsNlhg0FZ/+kUxtNKfA/jvcuJ98UBSOxIcIucqy1SKrNGD8YVJK4Dbi4r9oUWX54a4pHFbqQc424lfhfjzW50mTAzppU4KnjOjYcRj/3yAai4msA6EwWWjU5gEqU5BdCNWBMjg97iLcn550vWhtrduXODoCcok7PgVILDJva7eJDAwCwBLtO6uBcIuKCcMTYBGKrtz4ACY7U5O0LkD8s2n2+M8AkOMbDgU6j4DXe2ILqDcI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d9lC4NcVAADs5nAquIfECOIVQXUm+qUteLETObTcj31dvThZDfFIOEif5Zbv7iTW5pkyXgjiP5bT/8+s1+W7w/VgxPsjbK5fHflhYdx/OV6aeF0CAMxWissyzylerlf1/h+oKRk3H5hBywAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wMi0yNVQwMToyNjoxNC0wNTowMIPfac4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDItMjVUMDE6MjY6MTQtMDU6MDDygtFyAAAAAElFTkSuQmCC"; 31 | logo.width = 16; 32 | logo.height = 16; 33 | logo.classList.add("v-align-text-bottom"); 34 | link.appendChild(logo); 35 | 36 | let l = document.createElement("li"); 37 | l.appendChild(link); 38 | 39 | if (document.querySelector(".pagehead-actions")) { 40 | document.querySelector(".pagehead-actions").appendChild(l); 41 | } 42 | })(); 43 | -------------------------------------------------------------------------------- /Qireader-Keymap/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Qireader keymap 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @match https://www.qireader.com.cn/* 6 | // @match https://www.qireader.com/* 7 | // @grant none 8 | // @version 0.3 9 | // @author tmr 10 | // @grant GM_openInTab 11 | // @inject-into content 12 | // ==/UserScript== 13 | 14 | (function () { 15 | const keyMap = { 16 | b: OpenBGEntry, 17 | s: StarEntry, 18 | }; 19 | 20 | function onKeyDownEvent(event) { 21 | if (keyMap[event.key]) { 22 | console.log("key", event.key); 23 | if (keyMap[event.key]()) { 24 | event.preventDefault(); 25 | } 26 | } 27 | } 28 | document.addEventListener("keydown", onKeyDownEvent); 29 | 30 | let currEntry = null; 31 | document.addEventListener("mouseover", (event) => { 32 | currEntry = event.target.closest("div[data-is-entry]"); 33 | if (!currEntry) { 34 | currEntry = document.querySelector("article") 35 | } 36 | }); 37 | 38 | function EntryLink() { 39 | if (!currEntry) { 40 | return false; 41 | } 42 | if (currEntry.tagName == "DIV") { 43 | return currEntry.querySelector('a[data-is-entry-title="true"]').href; 44 | } 45 | if (currEntry.tagName == "ARTICLE") { 46 | return currEntry.dataset.articleUrl; 47 | } 48 | } 49 | 50 | function EntryNav() { 51 | if (!currEntry) { 52 | return []; 53 | } 54 | if (currEntry.tagName == "ARTICLE") { 55 | let nav; 56 | let parent = currEntry.parentElement; 57 | while (parent) { 58 | nav = Array.from(parent.children).find((e) => e.tagName === "NAV"); 59 | if (nav) { 60 | break; 61 | } 62 | parent = parent.parentElement; 63 | } 64 | if (nav) { 65 | return Array.from(nav.children); 66 | } 67 | } 68 | return []; 69 | } 70 | 71 | function StarEntry() { 72 | if (!currEntry) { 73 | return false; 74 | } 75 | if (currEntry.tagName == "DIV") { 76 | const menuEvent = new MouseEvent("contextmenu", { 77 | button: 2, 78 | bubbles: true, 79 | cancelable: true, 80 | }); 81 | currEntry.dispatchEvent(menuEvent); 82 | const menu = document.querySelector('div[data-is-menu="true"]'); 83 | menu 84 | .querySelectorAll("div>span") 85 | .forEach((e) => e.textContent === "稍后阅读" && e.click()); 86 | menu.remove(); 87 | return true; 88 | } 89 | if (currEntry.tagName == "ARTICLE") { 90 | EntryNav().forEach((e) => e.title === "稍后阅读" && e.click()); 91 | } 92 | } 93 | 94 | function ReadEntry(force = false) { 95 | if (!currEntry) { 96 | return false; 97 | } 98 | if (currEntry.tagName == "DIV") { 99 | const menuEvent = new MouseEvent("contextmenu", { 100 | button: 2, 101 | bubbles: true, 102 | cancelable: true, 103 | }); 104 | currEntry.dispatchEvent(menuEvent); 105 | const menu = document.querySelector('div[data-is-menu="true"]'); 106 | menu 107 | .querySelectorAll("div>span") 108 | .forEach( 109 | (e) => 110 | (e.textContent === "标记为已读" || (!force && e.textContent === "标记为未读") ) && 111 | e.click() 112 | ); 113 | menu.remove(); 114 | return true; 115 | } 116 | if (currEntry.tagName == "ARTICLE") { 117 | EntryNav().forEach((e) => (e.title === "标记为已读" || (!force && e.title === "标记为未读")) && e.click()); 118 | } 119 | } 120 | 121 | function OpenBGEntry() { 122 | if (!currEntry) { 123 | return false; 124 | } 125 | ReadEntry(true); 126 | GM_openInTab(EntryLink(), { 127 | active: false, 128 | }); 129 | return true; 130 | } 131 | })(); 132 | -------------------------------------------------------------------------------- /RSS-to-Clipboard/user.js: -------------------------------------------------------------------------------- 1 | javascript: (function () { 2 | let rsshub_host = 'https://rsshub.app'; 3 | let lilydjwg_host = 'https://rss.lilydjwg.me'; 4 | 5 | let cnblog = 'https://www.cnblogs.com/'; 6 | let csdn = 'https://blog.csdn.net/'; 7 | let feed43 = 'https://feed43.com'; 8 | let jianshu_user = '/jianshu/user/'; 9 | let zhihu_user = '/zhihu/people/activities/'; 10 | let zhihu_zhuanlan = '/zhihu/zhuanlan/'; 11 | let zhihu_collection = '/zhihu/collection/'; 12 | let bilibili_user = '/bilibili/user/video/'; 13 | let jike_topic = '/jike/topic/'; 14 | let jike_square = '/jike/topic/square/'; 15 | let jike_user = '/jike/user/'; 16 | let twitter_user = '/twitter/user/'; 17 | let weibo_user = '/weibo/user/'; 18 | let instagram_user = '/instagram/user/'; 19 | let youtube_channel = '/youtube/channel/'; 20 | let github_issues = '/github/issue/'; 21 | 22 | let feedurl = ''; 23 | let domain = location.host; 24 | let path = location.pathname.split('/'); 25 | let urlparam = new URLSearchParams(location.href); 26 | 27 | if (domain == 'www.cnblogs.com') { 28 | feedurl = cnblog + path[1] + '/rss'; 29 | } else if (domain == 'blog.csdn.net') { 30 | feedurl = csdn + path[1] + '/rss/list'; 31 | } else if (domain == 'feed43.com') { 32 | if (path[1].length - path[1].indexOf('.xml') == 4) { 33 | feedurl = location.href; 34 | } else if (path[1] == 'feed.html') { 35 | if (urlparam.has('name')) { 36 | feedurl = feed43 + '/' + urlparam.get('name') + '.xml'; 37 | } else { 38 | alert('Use it in Feed43 feed edit Page'); 39 | } 40 | } else { 41 | alert('Use it in Feed43 feed edit Page'); 42 | } 43 | } else if (domain == 'zhuanlan.zhihu.com') { 44 | if (path[1] == 'p') { 45 | alert('Use it in ZhihuZhuanlan home page'); 46 | } else { 47 | feedurl = lilydjwg_host + '/zhihuzhuanlan/' + path[1]; 48 | } 49 | } else if (domain == 'www.zhihu.com') { 50 | if (path[1] == 'people' || path[1] == 'org') { 51 | feedurl = lilydjwg_host + '/zhihu/' + path[2]; 52 | } else { 53 | alert('Use it in Zhihu user page'); 54 | return; 55 | } 56 | } 57 | if (feedurl != '') { 58 | console.log('RSS found in Website'); 59 | } else { 60 | console.log('RSS not found in Website'); 61 | console.log('Trying RSSHub ... '); 62 | let rsshub_path = ''; 63 | if (domain == 'www.jianshu.com') { 64 | if (path[1] == 'u') { 65 | rsshub_path = jianshu_user + path[2]; 66 | } else { 67 | alert('Use it in Jianshu user page'); 68 | return; 69 | } 70 | } else if (domain == 'www.zhihu.com') { 71 | if (path[1] == 'people' || path[1] == 'org') { 72 | rsshub_path = zhihu_user + path[2]; 73 | } else if (path[1] == 'collection') { 74 | rsshub_path = zhihu_collection + path[2]; 75 | } else { 76 | alert('Use it in Zhihu user page'); 77 | return; 78 | } 79 | } else if (domain == 'zhuanlan.zhihu.com') { 80 | if (path[1] == 'p') { 81 | alert('Use it in ZhihuZhuanlan home page'); 82 | return; 83 | } else { 84 | rsshub_path = zhihu_zhuanlan + path[1]; 85 | } 86 | } else if (domain == 'space.bilibili.com') { 87 | rsshub_path = bilibili_user + path[1]; 88 | } else if (domain == 'web.okjike.com') { 89 | if (path[1] == 'topic') { 90 | if (path[3] == 'official') { 91 | rsshub_path = jike_topic + path[2]; 92 | } else if (path[3] == 'user') { 93 | rsshub_path = jike_square + path[2]; 94 | } 95 | } else if (path[1] == 'user') { 96 | rsshub_path = jike_user + path[2]; 97 | } else { 98 | alert('Use it in Jike user or topic page'); 99 | return; 100 | } 101 | } else if (domain == 'twitter.com') { 102 | rsshub_path = twitter_user + path[1]; 103 | } else if (domain == 'm.weibo.cn') { 104 | if (path[1] == 'profile') { 105 | rsshub_path = weibo_user + path[2]; 106 | } else { 107 | alert('Use it in Weibo user home page'); 108 | return; 109 | } 110 | } else if (domain == 'weibo.com' || domain == 'www.weibo.com') { 111 | rsshub_path = weibo_user + $CONFIG.oid; 112 | } else if (domain == 'www.instagram.com') { 113 | if (path[1] == 'p') { 114 | alert('Use it in Instagram user home page'); 115 | return; 116 | } else { 117 | rsshub_path = instagram_user + path[1]; 118 | } 119 | } else if (domain == 'www.youtube.com') { 120 | if (path[1] == 'channel') { 121 | rsshub_path = youtube_channel + path[2]; 122 | } else { 123 | alert('Use it in YouTube channel page'); 124 | return; 125 | } 126 | } else if (domain == 'github.com') { 127 | if (path[3] == 'issues') { 128 | rsshub_path = github_issues + path[1] + '/' + path[2]; 129 | } else { 130 | alert('Use it in GitHub Issues page'); 131 | return; 132 | } 133 | } 134 | if (rsshub_path == '') { 135 | console.log( 136 | 'Rss not found, if rsshub supports this website, please contact me' 137 | ); 138 | console.log('https://blog.xlab.app/'); 139 | alert( 140 | 'Rss not found, if rsshub supports this website, please contact me' 141 | ); 142 | return; 143 | } else { 144 | console.log('RSS found in RSSHub'); 145 | feedurl = rsshub_host + rsshub_path; 146 | } 147 | } 148 | if (feedurl) { 149 | console.log(feedurl); 150 | const input = document.createElement('input'); 151 | document.body.appendChild(input); 152 | input.setAttribute('value', feedurl); 153 | input.select(); 154 | if (document.execCommand('copy')) { 155 | document.execCommand('copy'); 156 | console.log('Copy to clipboard'); 157 | alert('RSS copied to clipboard'); 158 | } 159 | document.body.removeChild(input); 160 | } 161 | })(); 162 | -------------------------------------------------------------------------------- /RSS-to-Inoreader/user.js: -------------------------------------------------------------------------------- 1 | javascript: (function () { 2 | let rsshub_host = 'https://rsshub.app'; 3 | 4 | let cnblog = 'https://www.cnblogs.com/'; 5 | let csdn = 'https://blog.csdn.net/'; 6 | let jianshu_user = '/jianshu/user/'; 7 | let zhihu_user = '/zhihu/people/activities/'; 8 | let zhihu_collection = '/zhihu/collection/'; 9 | let bilibili_user = '/bilibili/user/video/'; 10 | let jike_topic = '/jike/topic/'; 11 | let jike_square = '/jike/topic/square/'; 12 | let jike_user = '/jike/user/'; 13 | let twitter_user = '/twitter/user/'; 14 | let weibo_user = '/weibo/user/'; 15 | let instagram_user = '/instagram/user/'; 16 | let youtube_channel = '/youtube/channel/'; 17 | let github_issues = '/github/issue/'; 18 | 19 | let w = 800; 20 | let h = 600; 21 | let feedurl = ''; 22 | let domain = location.host; 23 | let path = location.pathname.split('/'); 24 | 25 | if (domain == 'www.cnblogs.com') { 26 | feedurl = cnblog + path[1] + '/rss'; 27 | } else if (domain == 'blog.csdn.net') { 28 | feedurl = csdn + path[1] + '/rss/list'; 29 | } 30 | if (feedurl != '') { 31 | console.log('RSS found in Website'); 32 | } else { 33 | console.log('RSS not found in Website'); 34 | console.log('Trying RSSHub ... '); 35 | let rsshub_path = ''; 36 | if (domain == 'www.jianshu.com') { 37 | if (path[1] == 'u') { 38 | rsshub_path = jianshu_user + path[2]; 39 | } else { 40 | alert('Use it in Jianshu user page'); 41 | return; 42 | } 43 | } else if (domain == 'www.zhihu.com') { 44 | if (path[1] == 'people' || path[1] == 'org') { 45 | rsshub_path = zhihu_user + path[2]; 46 | } else if (path[1] == 'collection') { 47 | rsshub_path = zhihu_collection + path[2]; 48 | } else { 49 | alert('Use it in Zhihu user page'); 50 | return; 51 | } 52 | } else if (domain == 'space.bilibili.com') { 53 | rsshub_path = bilibili_user + path[1]; 54 | } else if (domain == 'web.okjike.com') { 55 | if (path[1] == 'topic') { 56 | if (path[3] == 'official') { 57 | rsshub_path = jike_topic + path[2]; 58 | } else if (path[3] == 'user') { 59 | rsshub_path = jike_square + path[2]; 60 | } 61 | } else if (path[1] == 'user') { 62 | rsshub_path = jike_user + path[2]; 63 | } else { 64 | alert('Use it in Jike user or topic page'); 65 | return; 66 | } 67 | } else if (domain == 'twitter.com') { 68 | rsshub_path = twitter_user + path[1]; 69 | } else if (domain == 'm.weibo.cn') { 70 | if (path[1] == 'profile') { 71 | rsshub_path = weibo_user + path[2]; 72 | } else { 73 | alert('Use it in Weibo user home page'); 74 | return; 75 | } 76 | } else if (domain == 'weibo.com' || domain == 'www.weibo.com') { 77 | rsshub_path = weibo_user + $CONFIG.oid; 78 | } else if (domain == 'www.instagram.com') { 79 | if (path[1] == 'p') { 80 | alert('Use it in Instagram user home page'); 81 | return; 82 | } else { 83 | rsshub_path = instagram_user + path[1]; 84 | } 85 | } else if (domain == 'www.youtube.com') { 86 | if (path[1] == 'channel') { 87 | rsshub_path = youtube_channel + path[2]; 88 | } else { 89 | alert('Use it in YouTube channel page'); 90 | return; 91 | } 92 | } else if (domain == 'github.com') { 93 | if (path[3] == 'issues') { 94 | rsshub_path = github_issues + path[1] + '/' + path[2]; 95 | } else { 96 | alert('Use it in GitHub Issues page'); 97 | return; 98 | } 99 | } 100 | if (rsshub_path == '') { 101 | console.log('RSS not found'); 102 | } else { 103 | console.log('RSS found in RSSHub'); 104 | feedurl = rsshub_host + rsshub_path; 105 | } 106 | } 107 | if (feedurl) { 108 | console.log(feedurl); 109 | feedurl = 'https://www.inoreader.com/?add_feed=' + feedurl; 110 | } else { 111 | feedurl = 112 | 'https://www.inoreader.com/bookmarklet/subscribe/' + 113 | encodeURIComponent(location.href); 114 | } 115 | console.log(feedurl); 116 | let b = window.screenLeft != undefined ? window.screenLeft : screen.left; 117 | let c = window.screenTop != undefined ? window.screenTop : screen.top; 118 | let width = window.innerWidth 119 | ? window.innerWidth 120 | : document.documentElement.clientWidth 121 | ? document.documentElement.clientWidth 122 | : screen.width; 123 | let height = window.innerHeight 124 | ? window.innerHeight 125 | : document.documentElement.clientHeight 126 | ? document.documentElement.clientHeight 127 | : screen.height; 128 | let d = width / 2 - w / 2 + b; 129 | let e = height / 2 - h / 2 + c; 130 | let f = window.open( 131 | feedurl, 132 | new Date().getTime(), 133 | 'width=' + 134 | w + 135 | ', height=' + 136 | h + 137 | ', top=' + 138 | e + 139 | ', left=' + 140 | d + 141 | 'location=yes,resizable=yes,status=no,scrollbars=no,personalbar=no,toolbar=no,menubar=no' 142 | ); 143 | if (window.focus) { 144 | f.focus(); 145 | } 146 | })(); 147 | -------------------------------------------------------------------------------- /Rename-Zhuhu-Daily-Title/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 修改知乎日报标题 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 0.6 6 | // @description 修改知乎日报标题为文章标题 7 | // @author tmr 8 | // @match *://daily.zhihu.com/story/* 9 | // @grant none 10 | // ==/UserScript== 11 | 12 | (function () { 13 | 'use strict'; 14 | function rename() { 15 | let zh_title = document.querySelector("p[class=DailyHeader-title]").innerText; 16 | let new_title = zh_title + "-知乎日报"; 17 | if (document.title !== new_title) { 18 | document.title = new_title; 19 | } 20 | setTimeout(rename, 1000); 21 | } 22 | rename(); 23 | })(); -------------------------------------------------------------------------------- /Video-Auto-Fullscreen/user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 自动网页全屏播放 3 | // @namespace https://blog.xlab.app/ 4 | // @more https://github.com/ttttmr/UserJS 5 | // @version 0.9 6 | // @description 自动网页全屏播放,已支持Bilibili,腾讯视频 7 | // @author tmr 8 | // @match https://www.bilibili.com/video/av* 9 | // @match https://www.bilibili.com/bangumi/play/ss* 10 | // @match https://www.bilibili.com/bangumi/play/ep* 11 | // @match https://v.qq.com/x/page/* 12 | // @match https://v.qq.com/x/cover/* 13 | // @grant none 14 | // ==/UserScript== 15 | 16 | (function () { 17 | 'use strict'; 18 | let counter = 0; 19 | function fullscreen() { 20 | console.log('web fullscreen start'); 21 | webFull(); 22 | function webFull() { 23 | console.log('web fullscreen ing ' + counter); 24 | counter++; 25 | let fullscreenClass; 26 | if (location.host == 'www.bilibili.com') { 27 | fullscreenClass = '.bilibili-player-video-web-fullscreen'; 28 | } else if (location.host == 'v.qq.com') { 29 | fullscreenClass = '.txp_btn_fake'; 30 | } 31 | if (fullscreenClass) { 32 | // 尝试全屏 33 | if (document.querySelector(fullscreenClass)) { 34 | // 网页全屏 35 | document.querySelector(fullscreenClass).click(); 36 | console.log('web fullscreen success'); 37 | // 重置计数 38 | counter = 0; 39 | // 移除监听 40 | document.removeEventListener('visibilitychange', fullscreen); 41 | } 42 | // 失败并重试 43 | else { 44 | // 超过30次就退出 45 | if (counter > 30) { 46 | console.log('web fullscreen fail'); 47 | return; 48 | } 49 | // 延迟0.5秒重试 50 | setTimeout(webFull, 500); 51 | } 52 | } 53 | } 54 | } 55 | clickVideoLink(); 56 | function clickVideoLink() { 57 | window.onclick = function (mClick) { 58 | let mClickElement = mClick.target; 59 | // 视频链接 60 | let videoUrlList; 61 | // 视频Class 62 | let videoClassList; 63 | if (location.host == 'www.bilibili.com') { 64 | videoUrlList = [ 65 | 'https://www.bilibili.com/video/av', 66 | 'https://www.bilibili.com/bangumi/play/ss', 67 | 'https://www.bilibili.com/bangumi/play/ep', 68 | ]; 69 | videoClassList = [ 70 | 'bilibili-player-ending-panel-box-recommend-cover', 71 | 'bilibili-player-ending-panel-box-recommend', 72 | 'ep-title', 73 | 'ep-item', 74 | ]; 75 | } else if (location.host == 'v.qq.com') { 76 | videoUrlList = ['https://v.qq.com/x/page/']; 77 | videoClassList = []; 78 | } 79 | // 优先Class处理 80 | videoClassList.forEach(function (videoClass) { 81 | if (mClickElement.classList.contains(videoClass)) { 82 | fullscreen(); 83 | return; 84 | } 85 | }); 86 | // 链接处理 87 | let mClickElementTmp = mClickElement; 88 | // 判断是否是a标签的子元素 89 | while (mClickElementTmp) { 90 | // 元素是a标签 91 | if (mClickElementTmp.tagName == 'A') { 92 | // 新tab打开不处理 93 | if (mClickElementTmp.target == '_blank') { 94 | break; 95 | } else { 96 | // 循环判断链接 97 | videoUrlList.some(function (videoUrl) { 98 | if (String(mClickElementTmp.href).indexOf(videoUrl) == 0) { 99 | fullscreen(); 100 | return true; 101 | } 102 | }); 103 | break; 104 | } 105 | } 106 | // 不是a标签就循环父级元素 107 | else { 108 | mClickElementTmp = mClickElementTmp.parentElement; 109 | } 110 | } 111 | }; 112 | } 113 | window.addEventListener('load', function () { 114 | // 判断后台打开 115 | if (document.visibilityState == 'hidden') { 116 | console.log('now hidden, wait visible'); 117 | document.addEventListener('visibilitychange', fullscreen); 118 | } 119 | // 前台打开,直接直行 120 | else { 121 | fullscreen(); 122 | } 123 | }); 124 | })(); 125 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # UserJS 2 | 3 | 自己写的一些脚本收集 --------------------------------------------------------------------------------