├── .eslintrc.json ├── .gitignore ├── .tern-project ├── 360so_link_fix └── 360so_link_fix.user.js ├── LICENSE ├── README.md ├── auto_jd └── auto_jd.user.js ├── google_interstitial_link_fix └── google_interstitial_link_fix.user.js ├── mdn_cn └── mdn_cn.user.js ├── read_mode ├── logic.vsdx ├── read_mode.user.js ├── readme.md └── useage.png ├── reset_title.user.js ├── soTab ├── readme-old.md ├── soTab.user.js ├── style.css └── style.min.css ├── space_king ├── readme.md └── space_king.user.js ├── taobao_sort └── taobao_sort.user.js ├── wallhaven └── wallhaven.user.js ├── youdao_translate ├── p1.jpg ├── p2.png └── youdao_translate.user.js └── zhihu_link_fix └── zhihu_link_fix.user.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "browser": true, 5 | "greasemonkey": true, 6 | "jquery": true, 7 | "es6": true 8 | }, 9 | "globals": { 10 | "key": true //read_mode 11 | }, 12 | "rules": { 13 | "semi": [1, "always"], 14 | "no-unused-vars" : 0, 15 | "no-console": 0 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Example user template template 3 | ### Example user template 4 | 5 | # IntelliJ project files 6 | .idea 7 | *.iml 8 | out 9 | gen### Example user template template 10 | ### Example user template 11 | 12 | # IntelliJ project files 13 | gen### Linux template 14 | *~ 15 | 16 | # temporary files which can be created if a process still has a handle open of a deleted file 17 | .fuse_hidden* 18 | 19 | # KDE directory preferences 20 | .directory 21 | 22 | # Linux trash folder which might appear on any partition or disk 23 | .Trash-* 24 | 25 | # .nfs files are created when an open file is removed but is still being accessed 26 | .nfs* 27 | ### VisualStudioCode template 28 | .vscode/* 29 | !.vscode/settings.json 30 | !.vscode/tasks.json 31 | !.vscode/launch.json 32 | !.vscode/extensions.json 33 | ### Node template 34 | # Logs 35 | logs 36 | *.log 37 | npm-debug.log* 38 | yarn-debug.log* 39 | yarn-error.log* 40 | 41 | # Runtime data 42 | pids 43 | *.pid 44 | *.seed 45 | *.pid.lock 46 | 47 | # Directory for instrumented libs generated by jscoverage/JSCover 48 | lib-cov 49 | 50 | # Coverage directory used by tools like istanbul 51 | coverage 52 | 53 | # nyc test coverage 54 | .nyc_output 55 | 56 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 57 | .grunt 58 | 59 | # Bower dependency directory (https://bower.io/) 60 | bower_components 61 | 62 | # node-waf configuration 63 | .lock-wscript 64 | 65 | # Compiled binary addons (https://nodejs.org/api/addons.html) 66 | build/Release 67 | 68 | # Dependency directories 69 | node_modules/ 70 | jspm_packages/ 71 | 72 | # Typescript v1 declaration files 73 | typings/ 74 | 75 | # Optional npm cache directory 76 | .npm 77 | 78 | # Optional eslint cache 79 | .eslintcache 80 | 81 | # Optional REPL history 82 | .node_repl_history 83 | 84 | # Output of 'npm pack' 85 | *.tgz 86 | 87 | # Yarn Integrity file 88 | .yarn-integrity 89 | 90 | # dotenv environment variables file 91 | .env 92 | 93 | ### macOS template 94 | # General 95 | .DS_Store 96 | .AppleDouble 97 | .LSOverride 98 | 99 | # Icon must end with two \r 100 | Icon 101 | 102 | # Thumbnails 103 | ._* 104 | 105 | # Files that might appear in the root of a volume 106 | .DocumentRevisions-V100 107 | .fseventsd 108 | .Spotlight-V100 109 | .TemporaryItems 110 | .Trashes 111 | .VolumeIcon.icns 112 | .com.apple.timemachine.donotpresent 113 | 114 | # Directories potentially created on remote AFP share 115 | .AppleDB 116 | .AppleDesktop 117 | Network Trash Folder 118 | Temporary Items 119 | .apdisk 120 | ### Windows template 121 | # Windows thumbnail cache files 122 | Thumbs.db 123 | ehthumbs.db 124 | ehthumbs_vista.db 125 | 126 | # Dump file 127 | *.stackdump 128 | 129 | # Folder config file 130 | [Dd]esktop.ini 131 | 132 | # Recycle Bin used on file shares 133 | $RECYCLE.BIN/ 134 | 135 | # Windows Installer files 136 | *.cab 137 | *.msi 138 | *.msm 139 | *.msp 140 | 141 | # Windows shortcuts 142 | *.lnk 143 | -------------------------------------------------------------------------------- /.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaVersion": 6, 3 | "libs": [ 4 | "browser" 5 | ], 6 | "plugins": {} 7 | } 8 | -------------------------------------------------------------------------------- /360so_link_fix/360so_link_fix.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Link Redirect Fix for 360so 3 | // @name:zh-CN 360搜索真实链接地址重定向 4 | // @name:zh-TW 360搜索真實鏈接地址重定向 5 | // @description Avoid link redirect for 360 search 6 | // @description:zh-CN 搜索结果链接修正,直接跳转至目标网址,而不经过中间的二次跳转页面 7 | // @description:zh-TW 搜索結果鏈接修正,直接跳轉至目標網址,而不經過中間的二次跳轉頁面 8 | 9 | // @author Moshel 10 | // @namespace https://hzy.pw 11 | // @homepageURL https://hzy.pw/p/2056 12 | // @supportURL https://github.com/h2y/link-fix 13 | // @license GPL-3.0 14 | // @icon https://p.ssl.qhimg.com/t011a6c04685b5d3b80.png 15 | // @updateURL https://github.com/h2y/link-fix/raw/master/360so_link_fix/360so_link_fix.user.js 16 | 17 | // @grant none 18 | // @run-at document-end 19 | // @include https://www.so.com/s?* 20 | 21 | // @date 06/09/2016 22 | // @modified 08/07/2016 23 | // @version 1.0.1.1 24 | // ==/UserScript== 25 | 26 | 27 | !function() { 28 | 29 | var dom = null; 30 | function ajax_fixer() { 31 | var new_dom = document.querySelector('#m-result'); 32 | if (new_dom && new_dom !== dom) { 33 | dom = new_dom; 34 | main(); 35 | } 36 | setTimeout(ajax_fixer, 2222); 37 | } 38 | ajax_fixer(); 39 | 40 | 41 | function main() { 42 | var num = 0, 43 | as = dom.querySelectorAll('a'); 44 | for(var i=0; i=2) { 47 | as[i].href = decodeURIComponent(old[1]); 48 | num++; 49 | } 50 | } 51 | if(num) 52 | console.log(num+' 条链接已重定向至真实地址'); 53 | } 54 | 55 | }(); 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # H2y's Userscripts 2 | 3 | 这是数个独立的 UserScript 浏览器脚本,实现不同的功能,均可独立使用。共用这一个 Git 仓库。 4 | 5 | 如果你不知道浏览器脚本是什么,我的这篇文章会给与你帮助:[<使用UserScript加强你的浏览器>](https://hzy.pw/p/1872),一定会让你受益匪浅。 6 | 7 | 8 | ## F2 重设页面标题 /reset_title 9 | 10 | 当您在浏览网页时,想要设置一个更加个性化的页面标题,而不是使用默认的标题时,按下 F2 您就可以改名啦~ (^U^)ノ~YO 11 | 12 | 而且,这个脚本的特点就是不仅仅只是在当前页面有效,就算您刷新或者跳转到其他链接,设置的标题也会一直被保留下来哦~ 这样就可以方便您更好地区分出不同的标签页啦~ (^v^) 13 | 14 | **Greasyfork 在线安装: ** 15 | 16 | ## 有道一键网页翻译 /youdao_translate 17 | 18 | ![](https://h2y.github.io/link-fix/youdao_translate/p2.png) 19 | 20 | 传统的网页翻译插件将网页中的所有英文转换为中文,但用过的都知道,翻译出来的中文并不通顺,对于英语水平尚可的大多数中国用户而言,阅读这样的中文并不比原本的英文轻松多少。而该翻译工具不会直接全文翻译网页,而是保留全英文,同时将网页中的难词添加上注释,有效避免了全文翻译成中文后词不达意的情况。(该工具同时也支持划词翻译、全文翻译) 21 | 22 | > ^O^ 部分翻译:By 1860 the fort(堡垒) was remodeled(改造) into a military prison and became notorious(声名狼藉的) for incarcerating(监禁) gangsters(歹徒) including Al Capone. 23 | > 24 | > T.T 全文翻译:到1860年,被改造成堡军事监狱关押罪犯包括艾尔·卡彭和声名狼藉。 25 | 26 | ![](https://h2y.github.io/link-fix/youdao_translate/p1.jpg) 27 | 28 | 来源说明:本工具由网易官方的 [有道网页翻译 2.0](http://fanyi.youdao.com/web2/) 修改而成,这是猪厂提供的很好的一个服务,感谢。但由于年久失修原服务存在很多问题,已无法使用,于是我将其修复并打包成了该 UserScript。 29 | 30 | **Greasyfork 在线安装: ** 31 | 32 | 33 | ## 跳过谷歌网页风险提醒 /google_interstitial_link_fix 34 | 35 | 在谷歌搜索中,点击链接后常常会显示“警告 - 访问此网站可能会损害您的计算机!”的[页面](https://www.google.com/interstitial?url=http://bbs.tgbus.com/),往往我们都是选择离开。但问题是这个页面并不给我们继续访问的选择,我们只能复制链接到地址栏才能打开想要看的页面。而这个脚本为你添加了一键继续访问的按钮。 36 | 37 | **Greasyfork 在线安装: ** 38 | 39 | 40 | ## 空格之王 自动为中英文之间添加一个空格 /space_king 41 | 42 | 如果你跟我一样,每次看到网页上的中文字和英文、数字、符号挤在一块,就会坐立难安,忍不住想在它们之间加个空格。这个脚本正是你在网路世界走跳所需要的东西,它会自动替你在网页中所有的中文字和半形的英文、数字、符号之间插入空白。 43 | 44 | **Greasyfork 在线安装: ** 45 | 46 | 47 | ## 搜索引擎一键切换 /soTab 48 | 49 | 在常用的搜索引擎页面中添加互相切换的按钮,包括图片、视频、知道、学术搜索。 50 | 51 | 虽然同类脚本这不是第一款,但这是最省资源的一款。之前有幸使用过其他类似的脚本,太重,启用后全网监控,每个网页都要固定注入一大段 JS/CSS,看着都难受,于是索性自己写了重新写了个轻量级的。 52 | 53 | **Greasyfork 在线安装: ** 54 | 55 | 56 | ## 壁纸网站增强 /wallhaven 57 | 58 | 这是一个高质量的壁纸网站,本脚本增强了其使用体验,目前的功能如下: 59 | 60 | 1. 列表中淡化 star 数小于 10 的壁纸,让你更加关注于优秀的资源。 61 | 2. 为每张壁纸添加一个 \[一键保存\] 的按钮。 62 | 3. 淡化浏览过的壁纸。(需要登陆) 63 | 64 | **网站效果预览:** 65 | 66 | **Greasyfork 在线安装: ** 67 | 68 | 69 | ## MDN 首选中文 /mdn_cn 70 | 71 | 在 [developer.mozilla.org](https://developer.mozilla.org/zh-CN/) 阅读文档时,自动首选中文版本,避免手动切换。 72 | 73 | **Greasyfork 在线安装: ** 74 | 75 | 76 | ## 网页阅读模式 /read_mode 77 | 78 | [ALT+R] 将任何一个网页中影响您阅读的图片,视频,广告等无关内容过滤,仅查看最关注的那一部分内容。特别适合各种内容阅读型网页。同时提供将所选区域的 HTML 代码导出的功能。 79 | 80 | **Greasyfork 在线安装: ** 81 | 82 | 83 | ## 淘宝销量排序 /taobao_sort 84 | 85 | 在淘宝天猫浏览商品时,自动为你首选 [按销量排序],避免被潜在的竞价排名误伤。 86 | 87 | **Greasyfork 在线安装: ** 88 | 89 | 90 | ## 自动京东配送 /auto_jd 91 | 92 | 京东为了照顾第三方入驻商家,在浏览宝贝时默认不会勾选 [京东配送],那些第三方商家相比淘宝,不 “省” 也不 “多”,相比京东自营,不 “快” 也不 “好”,简直让人没有任何购买的理由。 93 | 94 | 所以我每次都要点 3 下,等待页面刷新 3 次,麻烦至极!于是开发了这款浏览器插件,实现了京东网浏览时,默认勾选 [京东配送] 和 [仅显示有货],并自动按销量排序! 95 | 96 | **Greasyfork 在线安装: ** 97 | 98 | 99 | ## 知乎真实链接地址重定向 /zhihu_link_fix 100 | 101 | 知乎网页中的站外链接会经过一次中转,使用此脚本后,将直接跳转至真实链接而非中转页面。 102 | 103 | 需要注意的是,脚本并不会在网页加载完后便转换所有的地址,只会在 **点击链接的瞬间** 才自动触发。 104 | 105 | **Greasyfork 在线安装: ** 106 | 107 | 108 | ## 360 搜索真实链接地址重定向 /360so_link_fix 109 | 110 | 脚本用于修正 360 搜索结果中的链接,直接跳转至目标网址,而不经过中间的二次跳转页面,加快网站进入的速度。 111 | 112 | 脚本会在每次搜索完成后自动触发。 113 | 114 | **Greasyfork 在线安装: ** 115 | 116 | 117 | ## 开源说明 118 | 119 | 我编写的所有 UserScript 开源在 Github 中,地址: 120 | 121 | 欢迎大家来看看[我的更多精彩的脚本](https://github.com/h2y/link-fix/#readme),提出你宝贵的建议,喜欢请 star :D 122 | 123 | 意见反馈请使用 Github,更方便我看到和处理: 124 | 125 | 如果没有 Github 账号欢迎在我的网站中留言: 126 | 127 | 128 | ## 其他优秀的脚本推荐 129 | 130 | 写在这里,不仅方便路过的各位找到更多实用脚本。也是我作为用户对这些作者们提供的优秀作品表示的由衷感谢。 131 | 132 | - AC-Baidu:绕过百度重定向直接访问网页: 133 | - Google:绕过搜索结果网页链接重定向: 134 | - 为豆瓣电影页面添加更多实用讯息: 135 | - 拒绝二维码登录:淘宝、京东等网站默认出现账号密码登录界面: 136 | -------------------------------------------------------------------------------- /auto_jd/auto_jd.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 自动京东配送 3 | // @name:zh-CN 自动京东配送 4 | // @name:zh-TW 自動京東配送 5 | // @description 在京东浏览商品时,可选择自动为你勾选 [京东配送]、[仅显示有货]、[销量排序]。方便实用! 6 | // @description:zh-CN 在京东浏览商品时,可选择自动为你勾选 [京东配送]、[仅显示有货]、[销量排序]。方便实用! 7 | // @description:zh-TW 在京東瀏覽商品時,可選擇自動為你勾選 [京東配送]、[僅顯示有貨]、[銷量排序]。方便實用! 8 | 9 | // @author Moshel 10 | // @namespace https://hzy.pw 11 | // @homepageURL https://hzy.pw/p/1349 12 | // @supportURL https://github.com/h2y/link-fix 13 | // @icon https://hzy.pw/wp-content/uploads/2015/04/i.jpeg 14 | // @license GPL-3.0 15 | // @updateURL https://github.com/h2y/link-fix/raw/master/auto_jd/auto_jd.user.js 16 | 17 | // @include *//search.jd.com/* 18 | // @include *//www.jd.com/pinpai/* 19 | // @include *//list.jd.com/list.html?* 20 | // @grant none 21 | // @run-at document-start 22 | 23 | // @version 2.4.0 24 | // @modified 02/07/2018 25 | // ==/UserScript== 26 | 27 | 28 | ! function() { 29 | 30 | // get GET attributes 31 | const $_GET = (function(){ 32 | let url = location.search; 33 | let u = url.split("?", 2); 34 | if(typeof(u[1]) === "string"){ 35 | u = u[1].split("&"); 36 | let get = {}; 37 | for(let i=0; i div._kge > ul'); 31 | let newLi = document.createElement("li"); 32 | newLi.innerHTML = `我已明白风险,继续访问该网页。`; 33 | ulDom.append(newLi); 34 | }(); 35 | -------------------------------------------------------------------------------- /mdn_cn/mdn_cn.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name MDN 首选中文 3 | // @description 在 developer.mozilla.org 阅读文档时,自动首选中文版本,避免手动切换。 4 | 5 | // @author Moshel 6 | // @namespace https://hzy.pw 7 | // @homepageURL https://hzy.pw/ 8 | // @supportURL https://github.com/h2y/link-fix 9 | // @icon https://blog.mozilla.com.tw/wp-content/uploads/mdn_logo_only_color.png 10 | // @license GPL-3.0 11 | // @updateURL https://github.com/h2y/link-fix/raw/master/mdn_cn/mdn_cn.user.js 12 | 13 | // @include https://developer.mozilla.org/en-US/* 14 | // @grant none 15 | // @run-at document-start 16 | 17 | // @version 1.0.2 18 | // @modified 05/03/2017 19 | // ==/UserScript== 20 | 21 | 22 | 23 | !function() { 24 | 25 | 26 | const allowLang = 'zh-CN', 27 | nowLang = 'en-US'; 28 | 29 | 30 | //check conditions 31 | if(document.referrer) { 32 | let splitRet = location.pathname.split(nowLang+'/', 2); 33 | if(splitRet.length!==2) 34 | return; // unknown location 35 | const nowPath = splitRet[1]; 36 | 37 | let regRet = document.referrer.match(/mozilla\.org\/(.+?)\/(.*)$/); 38 | if(regRet.length==3) { 39 | let lastLang = regRet[1], 40 | lastPath = regRet[2]; 41 | 42 | if(lastPath==nowPath) 43 | return; // user choose the English version manually 44 | } 45 | } 46 | 47 | 48 | location.pathname = location.pathname.replace(nowLang, allowLang); 49 | 50 | 51 | }(); 52 | -------------------------------------------------------------------------------- /read_mode/logic.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h2y/link-fix/a7afe3b1fa7f3d5c3412084579b6cef63b3d3107/read_mode/logic.vsdx -------------------------------------------------------------------------------- /read_mode/read_mode.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Page Read Mode 3 | // @name:zh-CN 网页阅读模式 4 | // @name:zh-TW 網頁閱讀模式 5 | // @description [ALT+R] Content reader on any page, selecting the text area automatically or manually. 6 | // @description:zh-CN [ALT+R] 将任何一个网页中影响您阅读的图片,视频,广告等无关内容过滤,仅查看最关注的那一部分内容。特别适合各种内容阅读型网页。同时提供将所选区域的 HTML 代码导出的功能。 7 | // @description:zh-TW [ALT+R] 將任何一個網頁中影響您閱讀的圖片,視頻,廣告等無關內容過濾,僅查看最關注的那一部分內容。特別適合各種內容閱讀型網頁。同時提供將所選區域的 HTML 代碼導出的功能。 8 | 9 | // @author Moshel 10 | // @namespace https://hzy.pw 11 | // @homepageURL https://hzy.pw/ 12 | // @supportURL https://github.com/h2y/link-fix 13 | // @icon https://wiki.greasespot.net/images/f/f3/Book.png 14 | // @license GPL-3.0 15 | // @updateURL https://github.com/h2y/link-fix/raw/master/read_mode/read_mode.user.js 16 | 17 | // @include * 18 | // @grant GM_setClipboard 19 | // *run-at context-menu 20 | // @require https://cdn.staticfile.org/keymaster/1.6.1/keymaster.min.js 21 | // @resource useageIMG https://github.com/h2y/link-fix/raw/master/read_mode/useage.png 22 | 23 | // @date 12/17/2015 24 | // @modified 01/23/2016 25 | // @version 1.1.2 26 | // ==/UserScript== 27 | 28 | 29 | /* 30 | global var 31 | */ 32 | let mode = 0, //状态标记 33 | topNode = null, //顶层节点 34 | styleNode = null, 35 | butNodes = null, 36 | useageNode = null; 37 | 38 | 39 | /* 40 | Tool functions 41 | */ 42 | function isNodeShow(node) { 43 | const styles = window.getComputedStyle(node); 44 | 45 | if(styles.display=='none' || styles.visibility=='hidden') 46 | return false; 47 | 48 | if(!parseInt(styles.height) || !parseInt(styles.height)) 49 | return false; 50 | 51 | return true; 52 | } 53 | 54 | 55 | /* 56 | main functions 57 | */ 58 | function enterCliping(e) { 59 | mode = 1; 60 | e.preventDefault(); 61 | 62 | //add style 63 | if(!styleNode) { 64 | styleNode = document.createElement('style'); 65 | styleNode.innerHTML = `.cliper-top-node { 66 | box-shadow: 0 0 20px #777 !important; 67 | border: 3px solid red !important; 68 | } .read-mode-reading { 69 | position: fixed !important; 70 | z-index: 9999970 !important; 71 | top: 0 !important; 72 | left: 0 !important; 73 | height: 100% !important; 74 | width: 100% !important; 75 | background-color: white !important; 76 | overflow: scroll !important; 77 | padding: 0 !important; 78 | border: 0 !important; 79 | margin: 0 !important; 80 | } .read-mode-buts { 81 | position: fixed; 82 | z-index: 9999985; 83 | top: 2rem; right: 1rem; 84 | } .read-mode-button { 85 | width: 54px; 86 | height: 54px; 87 | margin: 0 .5rem; 88 | padding: 10px 15px; 89 | color: #fff; 90 | opacity: .5; 91 | transition: 500ms; 92 | border-radius: 5px; 93 | background-color: black; 94 | } .read-mode-button:hover { 95 | background-color: white; 96 | border-radius: 0; 97 | box-shadow: 0 0 10px #000; 98 | color: #000; 99 | } img.read-mode-useage { 100 | position: fixed; 101 | right: 3rem; 102 | bottom: 2rem; 103 | z-index: 9999975; 104 | opacity: .7; 105 | }`; 106 | //styleNode.id = 'read_mode'; 107 | document.body.appendChild(styleNode); 108 | } 109 | 110 | // useage image 111 | if(!useageNode) { 112 | useageNode = document.createElement('img'); 113 | useageNode.src = 'https://github.com/h2y/link-fix/raw/master/read_mode/useage.png'; 114 | useageNode.className = 'read-mode-useage'; 115 | document.body.appendChild(useageNode); 116 | } 117 | 118 | useageNode.style.display = ''; 119 | 120 | //choose the init node 121 | topNode = document.body; 122 | let preNode = null; 123 | 124 | do { 125 | preNode = topNode; 126 | onDown(e); 127 | }while(preNode!=topNode && preNode.clientHeight*0.9 < topNode.clientHeight); 128 | } 129 | 130 | function quitCliping(e) { 131 | mode = 0; 132 | e.preventDefault(); 133 | 134 | useageNode.style.display = 'none'; 135 | 136 | changeTopNode(null); 137 | 138 | if(butNodes) 139 | butNodes.style.display = 'none'; 140 | 141 | topNode.classList.remove('read-mode-reading'); 142 | } 143 | 144 | 145 | function buildButNodes() { 146 | butNodes = document.createElement('div'); 147 | butNodes.className = 'read-mode-buts'; 148 | 149 | let buts = [ 150 | { 151 | text: "Exit read mode", 152 | handler: quitCliping, 153 | icon: '✘' 154 | }, { 155 | text: "Save HTML data", 156 | handler: onSaveHTML, 157 | icon: '❖' 158 | } 159 | ]; 160 | 161 | for(let but of buts) { 162 | let newBut = document.createElement('a'); 163 | newBut.className = 'read-mode-button'; 164 | newBut.innerHTML = but.icon; 165 | newBut.title = but.text; 166 | newBut.onclick = but.handler; 167 | butNodes.appendChild(newBut); 168 | } 169 | 170 | document.body.appendChild(butNodes); 171 | } 172 | 173 | 174 | function changeTopNode(newNode) { 175 | if(topNode) 176 | topNode.classList.remove('cliper-top-node'); 177 | 178 | if(newNode) 179 | newNode.classList.add('cliper-top-node'); 180 | else 181 | return; 182 | 183 | topNode = newNode; 184 | 185 | //scroll 186 | var winH = window.screen.availHeight, 187 | winY = window.scrollY, 188 | domH = topNode.clientHeight, 189 | domY = topNode.getBoundingClientRect().top + winY; 190 | //console.log(winH,winY,domH,domY); 191 | 192 | if(domH>winH) 193 | window.scrollTo(0, domY - 50 ); 194 | else 195 | window.scrollTo(0, domY - (winH-domH)/2 ); 196 | } 197 | 198 | 199 | /* 200 | Event handler 201 | */ 202 | function onSaveHTML(e) { 203 | let htmlStr = ''; 204 | 205 | htmlStr += topNode.outerHTML.split('\n').join('') 206 | .replace(/(id|class)=(\'.*?\'|\".*?\")/ig, '') 207 | .replace(//g, '') 208 | .replace(/>[\t ]+?<') 209 | .replace(/<(link|meta).*?>/ig, '') 210 | .replace(/.*?<\/style>/ig, '') 211 | .replace(/.*?<\/script>/ig, ''); 212 | 213 | GM_setClipboard(htmlStr); 214 | 215 | alert('Copied into clipboard.'); 216 | } 217 | 218 | 219 | function onUp(e) { 220 | if(!mode) return; 221 | e.preventDefault(); 222 | 223 | if(topNode.parentElement) 224 | changeTopNode(topNode.parentNode); 225 | } 226 | 227 | function onDown(e) { 228 | if(!mode) return; 229 | e.preventDefault(); 230 | 231 | if(!topNode.childElementCount) 232 | return; 233 | 234 | var scanNodes = topNode.children, 235 | maxNode = null; 236 | var maxHeight = -1; 237 | 238 | for(let node of scanNodes) 239 | if(isNodeShow(node) && node.clientHeight > maxHeight) { 240 | maxHeight = node.clientHeight; 241 | maxNode = node; 242 | } 243 | 244 | if(maxNode) 245 | changeTopNode(maxNode); 246 | } 247 | 248 | function onLeft(e) { 249 | if(!mode) return; 250 | e.preventDefault(); 251 | 252 | let nowNode = topNode; 253 | for(let node=nowNode; node.previousElementSibling;) { 254 | node = node.previousElementSibling; 255 | if(isNodeShow(node)) { 256 | nowNode = node; 257 | break; 258 | } 259 | } 260 | 261 | if(nowNode!=topNode) 262 | changeTopNode(nowNode); 263 | //else: up 264 | else if (topNode.parentNode) { 265 | let bakNode = nowNode = topNode; 266 | 267 | onUp(e); 268 | nowNode = topNode; 269 | 270 | onLeft(e); 271 | if(nowNode==topNode) 272 | changeTopNode(bakNode); 273 | else 274 | onDown(e); 275 | } 276 | } 277 | 278 | function onRight(e) { 279 | if(!mode) return; 280 | e.preventDefault(); 281 | 282 | let nowNode = topNode; 283 | for(let node=nowNode; node.nextElementSibling;) { 284 | node = node.nextElementSibling; 285 | if(isNodeShow(node)) { 286 | nowNode = node; 287 | break; 288 | } 289 | } 290 | 291 | if(nowNode!=topNode) 292 | changeTopNode(nowNode); 293 | //else: up 294 | else if (topNode.parentNode) { 295 | let bakNode = nowNode = topNode; 296 | 297 | onUp(e); 298 | nowNode = topNode; 299 | 300 | onRight(e); 301 | if(nowNode==topNode) 302 | changeTopNode(bakNode); 303 | else 304 | onDown(e); 305 | } 306 | } 307 | 308 | 309 | function onEnter(e) { 310 | if(!mode) return; 311 | e.preventDefault(); 312 | 313 | quitCliping(e); 314 | 315 | topNode.classList.add('read-mode-reading'); 316 | 317 | //buttons 318 | if(butNodes) 319 | butNodes.style.display = ''; 320 | else 321 | buildButNodes(); 322 | } 323 | 324 | 325 | /* 326 | Main 327 | */ 328 | key('alt+r', function(){ 329 | if(mode) 330 | quitCliping(new MouseEvent("main")); 331 | else 332 | enterCliping(new MouseEvent("main")); 333 | }); 334 | 335 | 336 | /* 337 | bind action 338 | */ 339 | key('up', onUp); 340 | key('down', onDown); 341 | key('left', onLeft); 342 | key('right', onRight); 343 | 344 | key('enter', onEnter); 345 | key('esc', quitCliping); 346 | -------------------------------------------------------------------------------- /read_mode/readme.md: -------------------------------------------------------------------------------- 1 | **对于这样的网页,我们想要看到的仅仅是正文,而不是广告或其他内容:** 2 | 3 | ![3](https://cloud.githubusercontent.com/assets/12909077/22208570/4caf3d2a-e1be-11e6-8588-6eea4d875912.JPG) 4 | 5 | **启用阅读模式后:** 6 | 7 | ![4](https://cloud.githubusercontent.com/assets/12909077/22208571/4cb08ea0-e1be-11e6-87c8-e20822833b16.JPG) 8 | 9 | ## 使用方法 10 | 11 | **在任何一个页面中按下 `ALT+R` 快捷键即可**,脚本会自动识别网页中的正文区域,再按下回车即可进入阅读模式,如果自动识别的区域不正确,可以在按回车键之前使用上下左右调整。 12 | 13 | ## 主要功能 14 | 15 | 将任何一个网页中影响您阅读的图片,视频,广告等无关内容过滤,仅查看最关注的那一部分内容。或者是通过此脚本将页面中关注的一个部分无损放大到全屏。 16 | 17 | 该脚本也可以将所选区域的 HTML 代码精简后导出,以供需要。*(TODO:导出的代码保留页面中的所有样式)* 18 | 19 | ## 区别 20 | 21 | 并没有同类脚本,但有浏览器扩展 `印象笔记·悦读` 实现了类似的功能。 22 | 23 | 较大的区别在于此脚本并不会将阅读的内容重排,因为我觉得这几乎是画蛇添足的行为,大多精美的排版都会因此崩掉,或者让页面中原有的按钮功能失效。 24 | 25 | 正是因为这样的设定,该脚本可以用在所有的页面中,将你需要的内容一剑放大到全屏。 26 | 27 | **比如微博,阅读起来内容太窄太小:** 28 | 29 | ![5](https://cloud.githubusercontent.com/assets/12909077/22209308/06982cd6-e1c1-11e6-84b5-ccbe4215b19a.JPG) 30 | 31 | **仅对我需要看的内容启用阅读模式:** 32 | 33 | ![6](https://cloud.githubusercontent.com/assets/12909077/22209309/069bf0be-e1c1-11e6-8942-df62d2e3dcbb.JPG) 34 | -------------------------------------------------------------------------------- /read_mode/useage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h2y/link-fix/a7afe3b1fa7f3d5c3412084579b6cef63b3d3107/read_mode/useage.png -------------------------------------------------------------------------------- /reset_title.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name [F2] Reset Page Title 3 | // @name:zh-CN [F2] 重设页面标题 4 | // @description Press F2 to reset the tab title 5 | // @description:zh-CN 按F2重新设置标签页标题 6 | 7 | // @author Moshel 8 | // @namespace https://hzy.pw 9 | // @supportURL https://github.com/h2y/link-fix 10 | // @license GPL-3.0 11 | // @downloadURL https://github.com/h2y/link-fix/raw/master/reset_title.user.js 12 | // @updateURL https://github.com/h2y/link-fix/raw/master/reset_title.user.js 13 | 14 | // @version 1.0.0 15 | // @match http://*/* 16 | // @match https://*/* 17 | // @grant none 18 | // @run-at document-body 19 | // @require https://cdn.staticfile.org/keymaster/1.6.1/keymaster.min.js 20 | // ==/UserScript== 21 | 22 | (function() { 23 | 'use strict'; 24 | 25 | let defaultTitle = document.title; 26 | let title = sessionStorage.getItem('title_by_userscript'); 27 | let intervalID = null; 28 | if (title) { 29 | startInterval(title); 30 | } 31 | 32 | function startInterval(newTitle) { 33 | title = newTitle; 34 | sessionStorage.setItem('title_by_userscript', newTitle); 35 | document.title = newTitle; 36 | if (!intervalID) { 37 | intervalID = setInterval(() => { 38 | document.title = title; 39 | }, 6666); 40 | } 41 | } 42 | 43 | key("f2", _ => { 44 | let newTitle = prompt('请为页面设置一个标题', title ? title : document.title); 45 | if (newTitle) { 46 | startInterval(newTitle); 47 | } else { 48 | clearInterval(intervalID); 49 | intervalID = null; 50 | document.title = defaultTitle; 51 | } 52 | }); 53 | })(); 54 | -------------------------------------------------------------------------------- /soTab/readme-old.md: -------------------------------------------------------------------------------- 1 | # soTab 搜索引擎一键相互切换脚本 2 | 3 | **这是一段 UserScript, 用于在浏览器中. 能让你在百度谷歌等搜索引擎中搜索东西时, 可以一键相互切换.** 4 | 5 | >虽然同类脚本这不是第一款, 但这是最省资源的一款. 6 | 7 | >之前有幸使用过其他类似的脚本, 太重, 启用后全网监控, 每个网页都要固定注入一大段 JS/CSS, 看着都难受, 于是索性自己写了重新写了个轻量级的. 8 | 9 | >**目前支持的搜索引擎:** _百度 , 必应 , 好搜 , ALLSO , 知乎 , 谷歌 , 清澄漫语 , 搜库 , 搜狗_ 10 | 11 | >**目前支持的搜索模式:** _网页 , 图片 , 知道 , 视频 , 学术_ 12 | 13 | . 14 | 15 | ![多模式支持](http://hzy.pw/wp-content/uploads/2015/12/QQ%E6%88%AA%E5%9B%BE20151213212724.jpg) 16 | 17 | ![切换界面隐藏样式](http://hzy.pw/wp-content/uploads/2015/12/QQ%E6%88%AA%E5%9B%BE20151213212623.jpg) 18 | 19 | ![切换界面激活样式](http://hzy.pw/wp-content/uploads/2015/12/QQ%E6%88%AA%E5%9B%BE20151213212640.jpg) 20 | 21 | . 22 | 23 | ## 安装方式 24 | 25 | 推荐使用 Greasyfork 在线安装: 26 | 27 | 也可以直接加载 Github 中的代码源文件, 点击: [soTab.user.js(RAW)](https://raw.githubusercontent.com/h2y/sotab/master/soTab.user.js) 28 | 29 | 如果你不知道浏览器脚本是什么, 我的这篇文章会给与你帮助: [使用UserScript加强你的浏览器](http://hzy.pw/p/1872), 一定会让你受益匪浅. 30 | 31 | ## 碎碎念 32 | 33 | 如果有好的想法和建议, 欢迎提交 Pull Request 或 Issue, 让我们努力使这个小脚本越发完善. 34 | 35 | 如果喜欢请 Star, 这是对我的一份肯定, 我会很开心的 :D 36 | 37 | 在这里顺便安利一下我自己写的 ALLSO 搜索引擎, Github 项目主页: [h2y/allso](https://github.com/h2y/allso). 特色是自动将屏幕一分为二, 同时展现左右两个搜索引擎的结果, 非常方便, 希望喜欢! 38 | -------------------------------------------------------------------------------- /soTab/soTab.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name soTab - Search Engine Switcher 3 | // @name:zh-CN 搜索引擎一键切换 soTab 4 | // @name:zh-TW 搜索引擎壹鍵切換 soTab 5 | // @description Add links to each other in search engines. Including multiple search modes. 6 | // @description:zh-CN 在常用的搜索引擎页面中添加互相切换的按钮,包括图片、视频、知道、学术搜索。 7 | // @description:zh-TW 在常用的搜索引擎頁面中添加互相切換的按鈕,包括圖片、視頻、知道、學術搜索。 8 | 9 | // @author Moshel 10 | // @namespace http://hzy.pw 11 | // @homepageURL http://hzy.pw/p/1849 12 | // @supportURL https://github.com/h2y/link-fix 13 | // @icon http://q.qlogo.cn/qqapp/100229475/F1260A6CECA521F6BE517A08C4294D8A/100 14 | // @updateURL https://github.com/h2y/link-fix/raw/master/soTab/soTab.user.js 15 | // @license GPL-3.0 16 | 17 | // @match *.baidu.com/* 18 | // @exclude *.baidu.com/link?* 19 | // @match *.so.com/* 20 | // @match *.bing.com/* 21 | // @match *.zhihu.com/search?* 22 | // @match *.soku.com/* 23 | // @match *.sogou.com/* 24 | // @match https://*.google.com/* 25 | // @match https://*.google.com.hk/* 26 | // @grant GM_addStyle 27 | // @grant window.onurlchange 28 | // @run-at document_end 29 | 30 | 31 | // @date 11/25/2022 32 | // @modified 12/18/2022 33 | // @version 1.5.2.00 34 | // ==/UserScript== 35 | (function () { 36 | function soTabInit() { 37 | if (top !== window) { 38 | console.log('soTab! not top window'); 39 | return; 40 | } 41 | 42 | // 判断搜索引擎,将仅使用hostname适配 43 | const sites = [ 44 | 'baidu', 45 | 'bing', 46 | 'so.com', 47 | '', 48 | 'zhihu', 49 | 'google', 50 | 'soku', 51 | 'sogou', 52 | ]; 53 | const sitesName = [ 54 | '百度', 55 | '必应', 56 | '好搜', 57 | 'ALLSO', 58 | '知乎', 59 | '谷歌', 60 | '搜库', 61 | '搜狗', 62 | ]; 63 | let siteID = -1; 64 | 65 | for (const site of sites) { 66 | if (site && location.hostname.includes(site)) { 67 | siteID = sites.indexOf(site); 68 | break; 69 | } 70 | } 71 | 72 | if (siteID === -1) { 73 | console.log("soTab can't match site."); 74 | return; 75 | } 76 | 77 | // 判断搜索类型,使用href适配 78 | let kind = []; 79 | // eslint-disable-next-line default-case 80 | switch (siteID) { 81 | case 0: 82 | kind = [ 83 | 'www.baidu', 84 | 'image.baidu', 85 | 'zhidao.baidu.com/search', 86 | 'v.baidu', 87 | 'xueshu.baidu.com/s', 88 | ]; 89 | break; 90 | case 1: // bing 91 | kind = [ 92 | '.com/search', 93 | '.com/images', 94 | '.com/knows/search', 95 | '.com/videos', 96 | '/academic/search', 97 | ]; 98 | break; 99 | case 2: 100 | kind = [ 101 | 'www.so', 102 | 'image.so', 103 | 'wenda.so.com/search', 104 | 'video.so', 105 | ]; 106 | break; 107 | case 4: // zhihu 108 | kind = ['', '', '.com/search']; 109 | break; 110 | case 5: // google 111 | kind = ['', 'tbm=isch', '', 'tbm=vid', 'scholar.google']; 112 | break; 113 | case 6: 114 | // kind[3] = "soku"; 115 | break; 116 | case 7: // sogou 117 | kind = [ 118 | ['/web?', '/sogou?', 'weixin.sogou', 'english.sogou'], 119 | 'pic.sogou', 120 | [ 121 | 'interation=196636', 122 | 'mingyi.sogou', 123 | 'wenwen.sogou', 124 | '.com/zhihu', 125 | ], 126 | 'v.sogou', 127 | '.com/xueshu', 128 | ]; 129 | break; 130 | } 131 | // 0:normal 1:pic 2:zhidao 3:video 4:xueshu 132 | let kindID = -1; 133 | for (let i = 0; i < kind.length; i++) { 134 | if (Array.isArray(kind[i])) { 135 | // 数组形式 136 | for (let j = 0; j < kind[i].length; j++) { 137 | if (location.href.includes(kind[i][j])) { 138 | kindID = i; 139 | break; 140 | } 141 | } 142 | if (kindID !== -1) break; 143 | } else if (location.href.indexOf(kind[i]) >= 0) { 144 | kindID = i; 145 | break; 146 | } 147 | } 148 | // 谷歌特殊处理 149 | if (siteID === 5 && kindID === -1) { 150 | if (location.href.indexOf('q=') >= 0) kindID = 0; 151 | } 152 | if (kindID === -1) { 153 | console.log('soTab! no kind found'); 154 | return; 155 | } 156 | 157 | // 初始化搜索路径 158 | // "百度", "必应", "好搜", "ALLSO", "知乎", "谷歌", "搜库", "搜狗" 159 | let links = []; // link[siteID] 160 | if (kindID === 0) { 161 | // normal 162 | links = [ 163 | 'https://www.baidu.com/s?wd=', 164 | 'https://cn.bing.com/search?q=', 165 | 'https://www.so.com/s?q=', 166 | 'http://h2y.github.io/allso/#', 167 | '', 168 | 'https://www.google.com/search?q=', 169 | '', 170 | 'https://www.sogou.com/web?query=', 171 | ]; 172 | } else if (kindID === 1) { 173 | // pic 174 | links = [ 175 | 'https://image.baidu.com/search/index?tn=baiduimage&word=', 176 | 'https://cn.bing.com/images/search?q=', 177 | 'https://image.so.com/i?q=', 178 | '', 179 | '', 180 | 'https://www.google.com/search?tbm=isch&q=', 181 | ]; 182 | } else if (kindID === 2) { 183 | // zhidao 184 | links = [ 185 | 'https://zhidao.baidu.com/search?word=', 186 | 'https://cn.bing.com/knows/search?q=', 187 | '', 188 | '', 189 | 'https://www.zhihu.com/search?q=', 190 | '', 191 | '', 192 | 'http://www.sogou.com/sogou?interation=196636&query=', 193 | ]; 194 | } else if (kindID === 3) { 195 | // video 196 | links = [ 197 | 'https://v.baidu.com/v?ie=utf-8&word=', 198 | '', 199 | 'https://video.so.com/v?q=', 200 | '', 201 | '', 202 | 'https://www.google.com/search?tbm=vid&q=', 203 | 'https://www.soku.com/v?keyword=', 204 | ]; 205 | } else if (kindID === 4) { 206 | // xueshu 207 | links = [ 208 | 'https://xueshu.baidu.com/s?wd=', 209 | 'https://cn.bing.com/academic/search?q=', 210 | '', 211 | '', 212 | '', 213 | 'https://scholar.google.com/scholar?q=', 214 | ]; 215 | } 216 | 217 | // 从url的searchParams中获取搜索关键词 218 | const searchParams = new URLSearchParams(location.search); 219 | const searchKeyWords = ['wd', 'word', 'w', 'q', 'query', 'search']; 220 | let searchWords = ''; 221 | searchKeyWords.forEach((keyWord) => { 222 | if (searchParams.has(keyWord)) { 223 | let initialWords = searchParams.get(keyWord); 224 | searchWords = encodeURIComponent(initialWords); 225 | } 226 | }); 227 | 228 | // 加载css 229 | 230 | const styleText = ` 231 | .soTab { 232 | position: fixed; 233 | background-color: #000; 234 | opacity: 0.3; 235 | border-radius: 40px; 236 | color: #fff; 237 | padding: 15px 20px; 238 | bottom: 100px; 239 | height: 40px; 240 | left: -320px; 241 | width: 300px; 242 | z-index: 9999999; 243 | transition: all 400ms; 244 | font-size: 14px; 245 | } 246 | .soTab:hover { 247 | left: 0px; 248 | opacity: 1; 249 | border-radius: 10px; 250 | box-shadow: 5px -5px 10px #777; 251 | } 252 | .soTab p { 253 | margin: 0; 254 | } 255 | p.soTab_title { 256 | font-weight: bold; 257 | margin-bottom: 3px; 258 | } 259 | .soTab a { 260 | color: #0cf; 261 | margin-right: 25px; 262 | } 263 | 264 | `; 265 | // 生成切换框 266 | const bodyDOM = document.getElementsByTagName('body')[0]; 267 | const soTabPanelDOM = document.createElement('div'); 268 | soTabPanelDOM.id = 'soTab'; 269 | let str = "

soTab 一键切换引擎:

"; 270 | for (const link of links) { 271 | if (link && links.indexOf(link) !== siteID) { 272 | str += `${sitesName[links.indexOf(link)]}`; 273 | } 274 | } 275 | 276 | soTabPanelDOM.innerHTML = `${str}

`; 277 | soTabPanelDOM.className = `b_soTab soTab soTab_site${siteID} soTab_kind${kindID}`;// b_必须放在className首位,否则bing会监听增加的DOM并删除增加的元素 278 | const oldSoTabDOM = document.getElementById('soTab'); 279 | if (oldSoTabDOM) { 280 | oldSoTabDOM.remove(); 281 | } 282 | const style = GM_addStyle(styleText); 283 | style.dataset.for = "result"; // 给style标签加上data-for= "result"属性,防止被百度删除 284 | bodyDOM.prepend(soTabPanelDOM);// 将dom添加到body前面,防止被百度和BING删除 285 | } 286 | if (window.onurlchange === null) { 287 | // feature is supported 288 | window.addEventListener('urlchange', () => { 289 | console.log('url has changed'); 290 | soTabInit(); 291 | }); 292 | } 293 | if (top === window) { 294 | console.log('init sotab here'); 295 | soTabInit(); 296 | } 297 | }()); // end userScript 298 | -------------------------------------------------------------------------------- /soTab/style.css: -------------------------------------------------------------------------------- 1 | .soTab { 2 | position: fixed; 3 | background-color: #000; 4 | opacity: 0.3; 5 | border-radius: 40px; 6 | color: #fff; 7 | padding: 15px 20px; 8 | bottom: 100px; 9 | height: 40px; 10 | left: -320px; 11 | width: 300px; 12 | z-index: 9999999; 13 | transition: all 400ms; 14 | font-size: 14px; 15 | } 16 | .soTab:hover { 17 | left: 0px; 18 | opacity: 1; 19 | border-radius: 10px; 20 | box-shadow: 5px -5px 10px #777; 21 | } 22 | .soTab p { 23 | margin: 0; 24 | } 25 | p.soTab_title { 26 | font-weight: bold; 27 | margin-bottom: 3px; 28 | } 29 | .soTab a { 30 | color: #0cf; 31 | margin-right: 25px; 32 | } -------------------------------------------------------------------------------- /soTab/style.min.css: -------------------------------------------------------------------------------- 1 | .soTab { position: fixed; background-color: #000; opacity: 0.3; border-radius: 40px; color: #fff; padding: 15px 20px; bottom: 100px; height: 40px; left: -320px; width: 300px; z-index: 9999999; transition: all 400ms; font-size: 14px; } .soTab:hover { left: 0px; opacity: 1; border-radius: 10px; box-shadow: 5px -5px 10px #777; } .soTab p { margin: 0; } p.soTab_title { font-weight: bold; margin-bottom: 3px; } .soTab a { color: #0cf; margin-right: 25px; } -------------------------------------------------------------------------------- /space_king/readme.md: -------------------------------------------------------------------------------- 1 | ## 空格之王 自动为中英文之间添加一个空格 2 | 3 | > **与 [為什麼你們就是不能加個空格呢?](https://greasyfork.org/zh-CN/scripts/2185) 脚本的区别和联系** 4 | > 5 | > 1. 是两个作用完全一致的脚本。 6 | > 2. 我们都调用了 Pangu.js 库进行空格处理,但那个脚本使用的是 2.5.6 版**且长期没有更新**,此脚本使用的是最新版本 3.3.0+。作为强迫症患者,自然得这么做。 7 | > 3. 代码上优化了实现方式。 8 | > 4. 那个脚本没有对一些不兼容网站做特殊处理(如谷歌图片搜索和谷歌翻译),此脚本完善了这些内容。 9 | 10 | ----------------------------------- 11 | 12 | 如果你跟我一样,每次看到网页上的中文字和英文、数字、符号挤在一块,就会坐立难安,忍不住想在它们之间加个空格。这个脚本正是你在网路世界走跳所需要的东西,它会自动替你在网页中所有的中文字和半形的英文、数字、符号之间插入空白。 13 | 14 | 汉学家称这个空白字元为「盘古之白」,因为它噼开了全形字和半形字之间的溷沌。另有研究显示,打字的时候不喜欢在中文和英文之间加空格的人,感情路都走得很辛苦,有七成的比例会在 34 岁的时候跟自己不爱的人结婚,而其馀三成的人最后只能把遗产留给自己的猫。毕竟爱情跟书写都需要适时地留白。 15 | 16 | 与大家共勉之。 17 | -------------------------------------------------------------------------------- /space_king/space_king.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 空格之王 自动为中英文之间添加一个空格 3 | // @name:zh-TW 空格之王 自動為中英文之間添加一個空格 4 | // @description 自动替你在网页中所有的中文字和半形的英文、数字、符号之间插入空白,让文字变得美观好看。 5 | // @description:zh-TW 自動替你在網頁中所有的中文字和半形的英文、數字、符號之間插入空白,讓文字變得美觀好看。 6 | 7 | // @author Moshel 8 | // @namespace https://hzy.pw 9 | // @homepageURL https://hzy.pw/ 10 | // @supportURL https://github.com/h2y/link-fix 11 | // @icon https://g.alicdn.com/mm/mm-brand/0.2.2/ico/favicon.ico 12 | // @license GPL-3.0 13 | 14 | // @include * 15 | // @exclude /^https://www.google\..+tbm=isch/ 16 | // @exclude https://translate.google.* 17 | // @exclude https://www.bilibili.com/video/* 18 | 19 | // @require https://cdn.jsdelivr.net/npm/pangu@4.0.7/dist/browser/pangu.min.js 20 | // @grant none 21 | // *run-at document-start 22 | // @version 4.0.7 23 | // @modified 07/11/2019 24 | // ==/UserScript== 25 | 26 | 27 | { 28 | let is_spacing = false; 29 | 30 | is_spacing = true; 31 | pangu.spacingPage(); 32 | is_spacing = false; 33 | 34 | 35 | document.addEventListener('DOMNodeInserted', function (e) { 36 | if (!is_spacing) { 37 | is_spacing = true; 38 | pangu.spacingNode(e.target); 39 | is_spacing = false; 40 | } 41 | }, false); 42 | } 43 | -------------------------------------------------------------------------------- /taobao_sort/taobao_sort.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Sort by Sales in Taobao 3 | // @name:zh-CN 淘宝销量排序 4 | // @name:zh-TW 淘寶銷量排序 5 | // @description In Tmall or Taobao, automatically for you first choice [by sales order]. Convenient and practical! 6 | // @description:zh-CN 在淘宝天猫浏览商品时,自动为你首选 [按销量排序]。方便实用! 7 | // @description:zh-TW 在淘寶天貓瀏覽商品時,自動為妳首選 [按銷量排序]。方便實用! 8 | 9 | // @author Moshel 10 | // @namespace https://hzy.pw 11 | // @homepageURL https://hzy.pw/p/1364 12 | // @supportURL https://github.com/h2y/link-fix 13 | // @icon https://hzy.pw/wp-content/uploads/2015/08/i-300x300.jpg 14 | // @license GPL-3.0 15 | // @updateURL https://github.com/h2y/link-fix/raw/master/taobao_sort/taobao_sort.user.js 16 | 17 | // @include /^https?://s.taobao.com/search\?.+/ 18 | // @include /^https?://list.tmall.com/search_product.htm\?.+/ 19 | // @grant none 20 | // @run-at document-start 21 | 22 | // @date 08/05/2015 23 | // @modified 06/11/2016 24 | // @version 1.4.2 25 | // ==/UserScript== 26 | 27 | 28 | ! function() { 29 | "use strict"; 30 | 31 | var href = location.search; 32 | 33 | /* 天猫搜索 */ 34 | if (location.hostname === "list.tmall.com" && href.indexOf("sort=") < 0) 35 | href += "&sort=d"; 36 | /* 淘宝搜索 */ 37 | else if (location.hostname === "s.taobao.com" && href.indexOf("sort=") < 0) 38 | href += "&sort=sale-desc"; 39 | /* 天猫淘宝店铺内搜索&分类浏览 40 | else if (location.search && href.indexOf("orderType=") < 0) 41 | href += "&orderType=hotsell_desc"; */ 42 | else 43 | return; 44 | 45 | /* 进行跳转 */ 46 | if (href !== location.search) 47 | location.search = href; 48 | 49 | }(); 50 | -------------------------------------------------------------------------------- /wallhaven/wallhaven.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Wallhaven Enhance 3 | // @name:zh-CN Wallhaven 壁纸网站增强 4 | // @description The script for the coolest wallpaper site provides additional features, can make you more fun to find favorite pictures. 5 | // @description:zh-CN Wallhaven 是最酷的壁纸网站,本脚本为该网站提供了额外的功能,能让你更畅快的寻找到喜欢的图片。 6 | 7 | // @author Moshel 8 | // @namespace https://hzy.pw 9 | // @homepageURL https://hzy.pw/ 10 | // @supportURL https://github.com/h2y/link-fix 11 | // @icon https://alpha.wallhaven.cc/favicon.ico 12 | // @license GPL-3.0 13 | // @updateURL https://github.com/h2y/link-fix/raw/master/wallhaven/wallhaven.user.js 14 | 15 | // require https://cdn.staticfile.org/lightgallery/1.6.12/css/lightgallery.min.css 16 | // require https://cdn.staticfile.org/lightgallery/1.6.12/js/lightgallery-all.min.js 17 | // @include https://wallhaven.cc/* 18 | // @grant none 19 | // @run-at document-end 20 | 21 | // @date 05/02/2017 22 | // @modified 06/06/2019 23 | // @version 2.1.0 24 | // ==/UserScript== 25 | 26 | 27 | { 28 | // 图片类 特指列表中的图片 29 | class Pic { 30 | constructor(elem, wallhavenScript) { 31 | this.elem = elem; 32 | this.wallhavenScript = wallhavenScript; 33 | 34 | const $pic = $(elem); 35 | 36 | this.favs = parseInt( $pic.find('.wall-favs')[0].innerHTML ); 37 | this.seen = $pic.find('figure').hasClass('thumb-seen'); 38 | this.id = $pic.find('figure').data('wallpaper-id'); 39 | this.isPNG = ($pic.find('span.png').length > 0); 40 | 41 | this.picUrl = `https://w.wallhaven.cc/full/zm/wallhaven-${this.id}.jpg`; 42 | if(this.isPNG) 43 | this.picUrl = this.picUrl.replace('.jpg', '.png'); 44 | } 45 | 46 | desalt() { 47 | const opacity = this.wallhavenScript.desaltPicsOpacity; 48 | this.elem.style.opacity = opacity; 49 | } 50 | 51 | addDownload() { 52 | let dlDom = $(` `)[0]; 53 | dlDom.onclick = this.download.bind(this); 54 | $(this.elem).find('.thumb-info').append(dlDom); 55 | } 56 | 57 | download() { 58 | let aDom = document.createElement('a'); 59 | aDom.href = this.picUrl; 60 | aDom.download = "download"; 61 | aDom.click(); 62 | } 63 | 64 | initGallery() { 65 | let $pic = $(this.elem).find('figure'); 66 | 67 | $pic.data('data-src', this.picUrl) 68 | .data('data-sub-html-url', 'https://wallhaven.cc/w/'+this.id ); 69 | 70 | $pic.click( this.showGallery ); 71 | } 72 | 73 | showGallery(e) { 74 | $('ul').lightGallery({ 75 | selector: 'figure' 76 | }); 77 | return false; 78 | } 79 | } 80 | 81 | 82 | class WallhavenScript { 83 | constructor() { 84 | // 部分页面中淡化对未达到点赞数量的图片 85 | this.desaltPics = true; 86 | this.desaltPicsByFavs = 10; // 需要达到的点赞数量 87 | this.desaltPicsOpacity = 0.2; // 淡化后的透明度 88 | 89 | // 淡化看过的图片 90 | this.desaltSeen = true; 91 | 92 | // 显示一键下载按钮 93 | this.download = true; 94 | 95 | // 图片灯箱浏览 96 | this.gallery = true; // 开发中 97 | 98 | // 单图页面尽可能扩大图片的可视空间 99 | this.maxView = true; 100 | 101 | // 当前登录状态 102 | this.isLogined = ($('#userpanel > a > span.username').length > 0) 103 | if(!this.isLogined) 104 | this.desaltSeen = false; 105 | } 106 | 107 | workList() { 108 | this.workListMain(); 109 | new MutationObserver( this.workListMain.bind(this) ).observe(document.body, { 110 | attributes: false, 111 | childList: true, 112 | subtree: true 113 | }); 114 | } 115 | 116 | workListMain() { 117 | let pics = this.getPics(); 118 | let newPics = this.filterNewPics(pics); 119 | 120 | for(let pic of newPics) { 121 | // 淡化对未达到点赞数量的图片 122 | if(this.desaltPics && pic.favs < this.desaltPicsByFavs) 123 | pic.desalt(); 124 | 125 | // 淡化看过的图片 126 | if(this.desaltSeen && pic.seen) 127 | pic.desalt(); 128 | 129 | // 显示一键下载按钮 130 | if(this.download) 131 | pic.addDownload(); 132 | 133 | // Gallery 134 | if(this.gallery) 135 | pic.initGallery(); 136 | } 137 | 138 | this.pics = pics; 139 | } 140 | 141 | // 单图页面 142 | workSingle() { 143 | /* 单图页面一键下载还存在问题 144 | if(this.download) { 145 | const src = $('img#wallpaper').attr('src'); 146 | 147 | let dlDom = $(``)[0]; 148 | dlDom.innerHTML = ` Download`; 149 | 150 | $('div.sidebar-content')[0].insertBefore(dlDom, $('.sidebar-content > #fav-button')[0] ); 151 | } */ 152 | 153 | if(this.maxView) { 154 | $('#header, #searchbar').hide('fast'); 155 | $('#showcase-sidebar').animate({top:0}, 'fast'); 156 | $('#main').animate({borderTopWidth:0}, 'fast'); 157 | $('#wallpaper').animate({maxWidth:'99%', maxHight:'99%'}, 'fast'); 158 | } 159 | } 160 | 161 | getPics() { 162 | let elems = $('.thumb-listing-page li'); 163 | let ret = []; 164 | 165 | for(let elem of elems) 166 | ret.push( new Pic(elem, this) ); 167 | 168 | return ret; 169 | } 170 | 171 | filterNewPics(pics) { 172 | let ret = []; 173 | const oldElems = this.pics.map(pic=>pic.elem); 174 | 175 | return pics.filter( pic => { 176 | return (oldElems.indexOf(pic.elem) < 0); 177 | }); 178 | } 179 | 180 | 181 | /* 182 | 根据当前页面选择需要运行的功能,返回对应的 work 函数 183 | */ 184 | run() { 185 | // A: 单图页面 186 | if(location.pathname.indexOf('/w/')==0) 187 | return this.workSingle(); 188 | 189 | // B: 列表页面 190 | 191 | // latest pics 192 | else if(location.pathname == '/latest' || location.search.indexOf('sorting=date_added')>0) { 193 | this.desaltPics = false; 194 | } 195 | 196 | // up 主页面 197 | else if(location.pathname.indexOf('/user/')>=0) 198 | this.desaltPics = false; 199 | 200 | this.pics = []; 201 | return this.workList(); 202 | } 203 | 204 | } 205 | 206 | 207 | new WallhavenScript().run(); 208 | 209 | } //end userScript 210 | -------------------------------------------------------------------------------- /youdao_translate/p1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h2y/link-fix/a7afe3b1fa7f3d5c3412084579b6cef63b3d3107/youdao_translate/p1.jpg -------------------------------------------------------------------------------- /youdao_translate/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h2y/link-fix/a7afe3b1fa7f3d5c3412084579b6cef63b3d3107/youdao_translate/p2.png -------------------------------------------------------------------------------- /zhihu_link_fix/zhihu_link_fix.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Zhihu Link Redirect Fix 3 | // @name:zh-CN 知乎真实链接地址重定向 4 | // @name:zh-TW 知乎真實鏈接地址重定向 5 | // @description Avoid link redirect for zhihu.com 6 | // @description:zh-CN 让知乎网页中的站外链接直接跳转至目标网址,而不经过一个二次跳转页面。重定向处理将会在点击链接瞬间自动触发 7 | // @description:zh-TW 讓知乎網頁中的站外鏈接直接跳轉至目標網址,而不經過壹個二次跳轉頁面。重定向處理將會在點擊鏈接瞬間自動觸發 8 | 9 | // @author Moshel 10 | // @namespace https://hzy.pw 11 | // @homepageURL https://hzy.pw/p/2056 12 | // @supportURL https://github.com/h2y/link-fix 13 | // @license GPL-3.0 14 | // @icon https://pic1.zhimg.com/2e33f063f1bd9221df967219167b5de0_m.jpg 15 | // @updateURL https://github.com/h2y/link-fix/raw/master/zhihu_link_fix/zhihu_link_fix.user.js 16 | 17 | // @grant none 18 | // @run-at document-start 19 | // @include *.zhihu.com/* 20 | 21 | // @date 06/10/2016 22 | // @modified 05/22/2019 23 | // @version 1.3.2.7 24 | // ==/UserScript== 25 | 26 | 27 | if(location.host==='link.zhihu.com') { 28 | let regRet = location.search.match(/target=(.+?)(&|$)/); 29 | if(regRet && regRet.length==3) 30 | location.href = decodeURIComponent(regRet[1]); 31 | } 32 | else 33 | window.addEventListener('click', function(e){ 34 | let dom = e.target, 35 | max_times = 5; 36 | while(dom && max_times--) { 37 | if(dom.nodeName.toUpperCase()==='A') { 38 | let regRet = dom.search.match(/target=(.+?)(&|$)/); 39 | if(regRet && regRet.length==3) 40 | dom.href = decodeURIComponent(regRet[1]); 41 | return; 42 | } 43 | else 44 | dom = dom.parentNode; 45 | } 46 | }); 47 | --------------------------------------------------------------------------------