├── .github └── ISSUE_TEMPLATE │ ├── ------customize-.md │ ├── ------feature-request-.md │ └── bug_report.md ├── Autoclose Zhihu Login.meta.js ├── Autoclose Zhihu Login.user.js ├── Font Rendering.meta.js ├── Font Rendering.user.js ├── Google & Baidu Switcher.meta.js ├── Google & Baidu Switcher.user.js ├── LICENSE ├── README.md ├── README_EN.md ├── images ├── Font Rendering │ ├── Example.gif │ ├── Exmaple_en.gif │ ├── FR-after.png │ ├── FR-before.png │ ├── VIP2.png │ ├── VIP2_en.png │ ├── VIP_en.png │ ├── additional fix.png │ ├── additional fix_en.png │ ├── allow.png │ ├── backup.png │ ├── backup_en.png │ ├── console.png │ ├── console_en.png │ ├── curSavadate.png │ ├── curSavadate_en.png │ ├── customMonospacedFontZone_en.png │ ├── customMonospacedFont_en.png │ ├── customfont_en.png │ ├── customfont_trigger.png │ ├── customfontlibrary_en.png │ ├── customfonts.png │ ├── errorRep.png │ ├── errorReport_en.png │ ├── exclude.png │ ├── exclude_en.png │ ├── fixshadow.png │ ├── fixshadow_en.png │ ├── fontRewriteZone_en.png │ ├── fontRewrite_en.png │ ├── fontScaleSetZone_en.png │ ├── fontScaleSet_en.png │ ├── fontSelect.png │ ├── fontSelect_en.png │ ├── fontlist.gif │ ├── fontoverwrite.png │ ├── fontrewritezone.png │ ├── fontscaleset.png │ ├── fontscalesetzone.png │ ├── include.png │ ├── includePan.png │ ├── includePan_en.png │ ├── include_en.png │ ├── insertFonts.png │ ├── loading.gif │ ├── manageExclude.png │ ├── manageExclude_en.png │ ├── menus.png │ ├── menus2.png │ ├── menus2_en.png │ ├── menus_en.png │ ├── monospace_custom.png │ ├── notallow.png │ ├── personalsetting.png │ ├── personalsetting_en.png │ ├── predefined-en.png │ ├── predefined.png │ ├── preview.png │ ├── preview_en.png │ ├── reset.png │ ├── reset_en.png │ ├── save.png │ ├── saveData_en.png │ ├── save_en.png │ ├── save_monospace_custom.png │ ├── save_monospace_custom_valid.png │ ├── savedate.png │ ├── scrollingbar.png │ ├── scrollingbar_en.png │ ├── settingUI.png │ ├── settingUI_en.png │ ├── tm_manifestv3.png │ ├── vip.png │ └── vm_manifestv3.png └── Google & Baidu Switcher │ ├── 360so.png │ ├── allSiteIcons.png │ ├── baidu.png │ ├── bing.png │ ├── brave.png │ ├── config.png │ ├── config_en.png │ ├── console.png │ ├── console_en.png │ ├── customColor.png │ ├── customColor_en.png │ ├── dev.baidu.png │ ├── duckduckgo.png │ ├── ecosia.png │ ├── filter.png │ ├── filter_en.png │ ├── google.png │ ├── list.png │ ├── list_en.png │ ├── menu.png │ ├── menu_en.png │ ├── qwant.png │ ├── searxng.png │ ├── sogou.png │ ├── startpage.png │ ├── swisscows.png │ ├── toutiao.png │ ├── yahoo.png │ ├── yandex.png │ ├── yep.png │ └── you.png └── lib ├── frColorPicker.js └── gbCookies.js /.github/ISSUE_TEMPLATE/------customize-.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 自定义问题(customize) 3 | about: 既不是报告错误也不是建议新功能的其他反馈 4 | title: '' 5 | labels: '' 6 | assignees: F9y4ng 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/------feature-request-.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 新功能要求(Feature request) 3 | about: 给这个项目的新想法或是提出新功能建议 4 | title: "[新增功能] " 5 | labels: '' 6 | assignees: F9y4ng 7 | 8 | --- 9 | 10 | ## 1. 准备工作(确认预先完成的操作) 11 | 12 | 13 | - [ ] 我确认使用的是当前脚本的最新版本。 14 | - [ ] 我已在Issues或Discussions中搜索过此需求,但没有找到类似的提案。 15 | 16 | ## 2. 请描述您所需要的新功能或新建议(清晰简明地描述您的需求是什么) 17 | 18 | 19 | ## 3. 附加信息或屏幕截图(此处添加可帮助表明您意图的附加信息或截图) 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 错误报告(Bug report) 3 | about: 创建错误报告以帮助我们改进 4 | title: "[发现错误] " 5 | labels: '' 6 | assignees: F9y4ng 7 | 8 | --- 9 | 10 | ## 1. 准备工作(确认预先完成的操作) 11 | 12 | 13 | - [ ] 我确认正在使用的是当前脚本的最新版本。 14 | - [ ] 我已在Issues或Discussions中搜索过此问题,但没有找到相关答案。 15 | - [ ] 我已在关闭浏览器其他扩展、仅开启此脚本的情况下测试,但依然出错。 16 | 17 | ## 2. 描述错误信息(清楚而简洁地描述错误) 18 | 19 | 20 | ## 3. 错误过程再现(请按示例填写行为步骤,直至复现您遇到的问题) 21 | 22 | 23 | 29 | 30 | ## 4. 屏幕截图(如有屏幕截图,请添加以帮助解释您的问题) 31 | 32 | 33 | ## 5. 预期结果(清晰明了地描述您所期待想要什么样的结果) 34 | 35 | 36 | ## 6. 客户端信息(请在“**冒号**”后认真填写您的本地信息) 37 | - 操作系统: 38 | - 浏览器: 39 | - 浏览器版本: 40 | - 脚本管理器: 41 | - 脚本管理器版本: 42 | - 所用的脚本名称: 43 | - 所用的脚本版本: 44 | - 其他补充信息: 45 | 46 | 47 | ## 7. 脚本运行环境排查 (请确认环境条件并填写相关信息) 48 | - 是否同时运行了其他浏览器扩展? 49 | 50 | 51 | 52 | - 是否同时运行了其他第三方用户脚本? 53 | 54 | 55 | 56 | ## 8. 附加信息(在此处添加您认为有用的其他信息) 57 | -------------------------------------------------------------------------------- /Autoclose Zhihu Login.meta.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 自动关闭知乎登录提示 3 | // @name:en Autoclose Zhihu Login Prompt 4 | // @name:zh-CN 自动关闭知乎登录提示 5 | // @name:zh-TW 自動關閉知乎登錄提示 6 | // @version 2025.01.01.1 7 | // @author F9y4ng 8 | // @namespace https://github.com/F9y4ng/GreasyFork-Scripts/ 9 | // @description 自动关闭知乎自动弹出的登录与注册提示,仅仅用于关闭自动弹出的登录提示,不干别的,未来也不会去干别的。 10 | // ==/UserScript== 11 | -------------------------------------------------------------------------------- /Autoclose Zhihu Login.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 自动关闭知乎登录提示 3 | // @name:en Autoclose Zhihu Login Prompt 4 | // @name:zh-CN 自动关闭知乎登录提示 5 | // @name:zh-TW 自動關閉知乎登錄提示 6 | // @version 2025.01.01.1 7 | // @author F9y4ng 8 | // @description 自动关闭知乎自动弹出的登录与注册提示,仅仅用于关闭自动弹出的登录提示。 9 | // @description:en Autoclose Zhihu Login Prompt is only used to close the pop-up login and registration prompt. 10 | // @description:zh-CN 自动关闭知乎自动弹出的登录与注册提示,仅仅用于关闭自动弹出的登录提示。 11 | // @description:zh-TW 自動關閉知乎自動彈出的登錄與註冊提示,僅僅用於關閉自動彈出的登錄提示。 12 | // @namespace https://github.com/F9y4ng/GreasyFork-Scripts/ 13 | // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/UlEQVR4nOWUuw4BURCGP5e4vYInUKkIjV6iI/EMtCqdqCREovUIWo030Go8AFFolCISrGwyJ1nr7FqXkwh/MsXO/LPf2dnZhV9UCMiYBBQAC5iZAgwFMDBxc3s8KwHoQsmrrvPeqBiwyXoV4B6P5WFW+YomfAEzKRZMAZAVtd+FMYBSTIxHDAHSYtx8GvDMFlW+EqA0EmOHe70NiANbMeaA5KcBbTEtgAkwdayuE6CiBayDfMm2SrKaF6AO7KSh4QM4B/1V1IC9GPqSq8r1Ach6jOoE9ICE38nLjoYxEHHUxpLvagBLIE8ARYE50NTUUvIkbj08tVvhZ8z8ha7sfKGJ8u/ZpQAAAABJRU5ErkJggg== 14 | // @homepage https://f9y4ng.github.io/GreasyFork-Scripts/ 15 | // @homepageURL https://f9y4ng.github.io/GreasyFork-Scripts/ 16 | // @supportURL https://github.com/F9y4ng/GreasyFork-Scripts/issues 17 | // @updateURL https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Autoclose%20Zhihu%20Login.meta.js 18 | // @downloadURL https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Autoclose%20Zhihu%20Login.user.js 19 | // @match *://*.zhihu.com/* 20 | // @grant none 21 | // @noframes true 22 | // @compatible Edge version>=105 23 | // @compatible Chrome version>=105 24 | // @compatible Firefox version>=103 25 | // @compatible Opera version>=91 26 | // @compatible Safari version>=15.4 27 | // @license GPL-3.0-only 28 | // @copyright 2023-2025, F9y4ng 29 | // @run-at document-start 30 | // ==/UserScript== 31 | 32 | /* jshint esversion: 11 */ 33 | 34 | void (function (w) { 35 | "use strict"; 36 | 37 | if (location.hostname.startsWith("link.")) { 38 | const target = decodeURIComponent(new URLSearchParams(location.search).get("target")); 39 | document.documentElement.textContent = ""; 40 | location.replace(target); 41 | } else { 42 | const observer = new MutationObserver(hiddenLogin); 43 | const config = { childList: true, subtree: true }; 44 | observer.observe(document, config); 45 | } 46 | 47 | function hiddenLoginNode(node) { 48 | const loginNode = node.querySelector(`button[aria-label="关闭"][class~='Modal-closeButton']`); 49 | if (!loginNode) return; 50 | document.documentElement.removeAttribute("style"); 51 | if (!w.event?.type) loginNode.click(); 52 | } 53 | 54 | function hiddenFloatNode(node) { 55 | const registFloatNode = node.querySelector(`body>div:not([class],[style],[id]):not(:has(.Modal-content)):not(:has(img[class~='Avatar'])) div[class^='css-']:has(svg[class*='css-'])`); 56 | if (registFloatNode) registFloatNode.style.display = "none"; 57 | } 58 | 59 | function hiddenLogin(mutationsList) { 60 | mutationsList.forEach(mutation => { 61 | if (mutation.type !== "childList" && mutation.target.nodeName !== "BODY") return; 62 | mutation.addedNodes.forEach(node => { 63 | if (node.nodeName !== "DIV" || node.attributes.length !== 0) return; 64 | hiddenLoginNode(node); 65 | hiddenFloatNode(node); 66 | }); 67 | }); 68 | } 69 | })(typeof window !== "undefined" ? window : this); 70 | -------------------------------------------------------------------------------- /Font Rendering.meta.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 字体渲染(自用脚本) 3 | // @name:zh-CN 字体渲染(自用脚本) 4 | // @name:zh-TW 字型渲染(自用程式碼) 5 | // @name:en Font Rendering (Customized) 6 | // @name:ko 글꼴 렌더링(자체 스크립트) 7 | // @name:ja フォントレンダリング 8 | // @version 2025.05.03.1 9 | // @author F9y4ng 10 | // @namespace https://github.com/F9y4ng/GreasyFork-Scripts/ 11 | // @description 无需安装MacType,优化浏览器字体渲染效果,让每个页面的字体变得更有质感。默认使用“微软雅黑”字体,也可根据喜好自定义其他字体使用。脚本针对浏览器字体渲染提供了字体重写、字体平滑、字体缩放、字体描边、字体阴影、对特殊样式元素的过滤和许可、自定义等宽字体等高级功能。脚本支持全局渲染与个性化渲染功能,可通过“单击脚本管理器图标”或“使用快捷键”呼出配置界面进行参数配置。脚本已兼容绝大部分主流浏览器及主流脚本管理器,且兼容常用的油猴脚本和浏览器扩展。 12 | // ==/UserScript== 13 | -------------------------------------------------------------------------------- /Google & Baidu Switcher.meta.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Google & baidu Switcher (ALL in One) 3 | // @name:en Search Engine Assistant 4 | // @name:zh-CN 优雅的搜索引擎助手 5 | // @name:zh-TW 優雅的搜尋引擎助手 6 | // @name:ru помощник поисковых систем 7 | // @name:ja 優雅な検索エンジン助手 8 | // @version 2025.05.03.1 9 | // @author F9y4ng 10 | // @description "Elegant search engine assistant" allows switching between engines; supports custom engines, keyword highlighting; offers redirect removal, ad blocking, keyword filtering, and auto-updates; compatible with Baidu, Google, Bing, Duckduckgo, Yandex, Sogou, Qwant, Ecosia, You, Startpage, Brave, Yahoo, Yep, Swisscows, searXNG and more. 11 | // @namespace https://github.com/F9y4ng/GreasyFork-Scripts/ 12 | // @note {"CN":"优化 baidu.com 跳转按钮样式。","EN":"Optimized the style of baidu.com jump button."} 13 | // @note {"CN":"优化 bing.com 搜索框的样式。","EN":"Optimized the style of bing.com search box."} 14 | // @note {"CN":"优化 You.com 跳转按钮的加载逻辑。","EN":"Improved loading logic of You.com jump button."} 15 | // @note {"CN":"修正一些已知问题,优化代码,优化样式。","EN":"Fixed some known issues, optimized code & style."} 16 | // ==/UserScript== 17 | -------------------------------------------------------------------------------- /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 | 635 | Copyright (C) 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 notice like 653 | this when it starts in an interactive mode: 654 | 655 | Copyright (C) 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 | # [**GreasyFork-Scripts**](https://f9y4ng.github.io/GreasyFork-Scripts/) - F9y4ng - [![WIKI](https://img.shields.io/badge/WIKI-GREASYFORK%20SCRIPTS-brightgreen.svg?logo=github "wiki")](https://github.com/F9y4ng/GreasyFork-Scripts/wiki) 2 | 3 | **页面语言** (**Language**) | 中文 (Chinese) | [英语 (English)](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/README_EN.md) 4 | 5 | [![LICENSE](https://img.shields.io/badge/License-GPL--3.0--only-blue.svg?style=for-the-badge&logo=github "LICENSE")](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/LICENSE) [![LAST COMMIT](https://img.shields.io/github/last-commit/F9y4ng/GreasyFork-Scripts?color=blue&logo=github&style=for-the-badge "LAST COMMIT")](https://github.com/F9y4ng/GreasyFork-Scripts/commits/master) [![ISSUES](https://img.shields.io/github/issues/F9y4ng/GreasyFork-Scripts?logo=github&style=for-the-badge "ISSUES")](https://github.com/F9y4ng/GreasyFork-Scripts/issues) [![STARS](https://img.shields.io/github/stars/F9y4ng/GreasyFork-Scripts?color=brightgreen&logo=github&style=for-the-badge "STARS")](https://github.com/F9y4ng/GreasyFork-Scripts/stargazers) 6 | 7 | - 请先安装**脚本管理器**扩展(如:Tampermonkey, Violentmonkey, Greasemonkey),然后再**安装脚本**。 8 | - **Chrome**, **Firefox** 推荐安装 **Tampermonkey/Violentmonkey**,**Safari** 推荐安装 **Tampermonkey**. 9 | - 使用 **Adguard桌面版** 或 **Userscripts** 等脚本管理器,可通过**键盘快捷键**呼出脚本管理菜单。 10 | 11 | --- 12 | 13 | ### 加入 Telegram 频道(频道名称:GreasyFork-Scripts) 14 | * 频道地址:https://t.me/+1e8Ebdy-mtdhY2Rl 15 | * 如果您喜欢本项目,请在页面右上角 ⭐Start 它,感谢您的支持。 16 | * 此频道用于讨论桌面浏览器的用户脚本的问题反馈和功能建议。 17 | 18 | --- 19 | 20 | ## 字体渲染(自用脚本) [`Font Rendering.user.js`](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/Font%20Rendering.user.js) 21 | 22 | 简介:无需安装MacType,优化浏览器字体渲染效果,让每个页面的字体变得更有质感。默认使用“微软雅黑”字体,也可根据喜好自定义其他字体使用。脚本针对浏览器字体渲染提供了字体重写、字体平滑、字体缩放、字体描边、字体阴影、对特殊样式元素的过滤和许可、自定义等宽字体等高级功能。脚本支持全局渲染与个性化渲染功能,可通过“单击脚本管理器图标”或“使用快捷键”呼出配置界面进行参数配置。脚本已兼容绝大部分主流浏览器及主流脚本管理器,且兼容常用的油猴脚本和浏览器扩展。 23 | 24 | - [新手上路,请使用前仔细阅读脚本使用说明,以及当前页面内相关注意事项。](https://github.com/F9y4ng/GreasyFork-Scripts/wiki/%E5%AD%97%E4%BD%93%E6%B8%B2%E6%9F%93%EF%BC%88%E8%87%AA%E7%94%A8%E8%84%9A%E6%9C%AC%EF%BC%89) 25 | - 脚本错误、异常请反馈至{[Issues](https://github.com/F9y4ng/GreasyFork-Scripts/issues)}, 字体、渲染样式、乱码问题请反馈至{[Discussions](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/categories/%E9%97%AE%E7%AD%94%E4%B8%93%E5%8C%BA-question-answer)}。 26 | - 为保证您的数据安全,请及时备份您的本地数据!请勿使用来源未知的备份文件。 27 | 28 | ### version 2025.05.03.1 - 更新日志: 【🔥[安装此脚本](https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Font%20Rendering.user.js)】 29 | 30 | ```log 31 | @ 修复视口单位修正功能中 @import 的引用问题。 32 | @ 优化粗体样式修正功能脚本冲突检测的兼容性。 33 | @ 优化对泛域名下预定义数据的解析支持。 34 | @ 修复一些已知的问题,优化代码,优化样式。 35 | ``` 36 | 37 | ### **字体渲染** 新版本,使用前请注意以下事项: 38 | 39 | - 新版脚本中**内置了默认的字体渲染样式,该样式为我的本地配置,并不能完美适配于你的计算机**。所以,首次使用时,如果出现渲染效果没有达到理想状态,属于**正常情况**。请根据**自有显示器的配置及设置**,通过**脚本配置界面**修正相关参数来达到最佳显示效果。 40 | - 老用户从旧版本升级至最新版时,如遇到样式异常,可通过重置功能重置数据来使用最新规则来尝试纠正问题。大版本(数据重建)更新不建议您使用备份还原,请重新配置渲染参数并保存,记得再次备份新数据。 41 | - **注意**:在Win10/Win11下,不论高分屏或低分屏,只要系统或浏览器应用150%以上缩放率即可获得最佳渲染效果,这是Windows默认渲染机制所决定的。 42 | 43 | ### 脚本延迟加载的处理办法 44 | * [脚本延迟加载造成页面二次渲染问题的解决办法](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/368) 45 | 46 | ### 问题反馈 47 | 48 | **注意**:使用浏览器、脚本管理器的`Beta、Dev、Canary、Nightly`等测试分支可能出现未知的兼容错误,脚本不会修正测试版本的错误,**如必须使用测试版本并对脚本有极高要求,建议你选择其他同类脚本**。因有极小概率发生数据被异常初始化,**请及时备份您的本地数据!!!** 49 | 50 | **反馈问题请注意**:反馈脚本错误或样式问题,请把**仅使用本脚本**情况下发生问题的**访问网址**、使用的**浏览器版本**、**脚本管理器版本**、**错误截图**、以及**操作流程**或**错误提示**(如果有的话)发出来,你遇到的问题不一定能在我本地复现。 51 | 52 | - [特定网站样式错误修正的设置分享,不定期更新,自取自用。](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/42) 53 | - [分享:关于分别设置英文字体和中文字体的方法。](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/83) 54 | - [如何正确地对不同显示器、浏览器设定字体渲染参数?](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/160) 55 | 56 |
57 | 点击查看 - 如何提供脚本错误日志? 58 | 59 | #### 获取并上传脚本错误日志 60 | 1. 先打开脚本调试开关: 61 | - v2023.04.08.1 以上版本,向 URL 添加 `?whoami=F9y4ng` 或 `&whoami=F9y4ng`,开启临时调试模式。 62 | - 使用旧版本需将代码大约第 54 行 `const IS_OPEN_DEBUG = false` 改为 `true`,并保存。 63 | 64 | 2. 在浏览器中按 F12 打开控制台面板,刷新页面,操作直至复现问题,在控制台空白处右键菜单选择 **另存为...**。 65 | 66 | 3. 进行 **错误报告(Bug report)**,并将保存好的日志文件打包上传至 [Github ISSUES](https://github.com/F9y4ng/GreasyFork-Scripts/issues)。 67 | 68 | 4. 日常使用时,请勿开启脚本调试开关,以免造成脚本执行缓慢等情况。 69 | 70 |
71 | 72 | ### 自定义字体的添加 73 | 74 | **如果您需要向字体表添加自定义字体,请按[帮助说明](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/64)进行操作。** 字体表字体及其他中文字体分享:[点这里下载](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/46) 75 | 76 | 请将 **完整且准确** 的字体 **中英文名称** 及 **PostScript 名称** 按 **预设格式** 添加进自定义字体列表。 77 | 78 | 格式如右:`{"ch":"鸿蒙黑体", "en":"HarmonyOS Sans SC", "ps":"HarmonyOS_Sans_SC"}` 79 | 80 |
81 | 点击查看 - 添加新字体到自定义字体表的注意事项 82 | 83 | #### 自定义字体的注意事项 84 | - 新增字体,一般接受字重为 **标准体/Regular** 的字体,需调整字重粗体请使用字体描边进行设置。 85 | - “ps:”表示字体 PostScript 名称,此为可选属性。为实现字体全局生效,请尽可能填写"ps:"属性。 86 | - 很多字体存在各种修改版本,非原版字体会造成字体名或属性不一致,从而使得代码无法识别。 87 | 88 | 每当计算机安装了新字体,要使其**立即生效**,请务必先**重启浏览器**,并在“**高级核心功能设置**”中重建字体列表缓存。 89 | 90 | - 注 1:自定义字体表的**编辑保存操作**会自动触发字体列表全局缓存的重建,无需额外手动处理。 91 | - 注 2:若仅安装**内置字体表**定义的字体,重启浏览器后,需要**手动**重建字体列表全局缓存。 92 |
93 | 94 | ### 字体比例缩放(实验性功能) 95 | 96 | 字体比例缩放功能,默认关闭,请在 **高级核心功能设置** 中打开字体缩放功能。 97 | 98 | - **已知问题一:** 由于 Firefox(Gecko Version < 126) 及 Greasemonkey、Userscripts 扩展的兼容性原因,仅修正了脚本内部坐标偏移问题,但会对部分网站样式、功能兼容不足,请根据需求酌情使用。**强烈建议您**:使用 Firefox 自身缩放功能替代(`Ctrl++`, `Ctrl+-`)。 99 | 100 | - **已知问题二:** 针对视口单位 `vw, vh, vmin, vmax` 的修正已完成,已解决在字体缩放后视口单位长度不准确的问题。该功能为**实验性功能**,默认关闭,可在**高级核心功能设置**中开启。 101 | 102 |
103 | 开启视口修正功能后,日常使用时遇到样式异常时,请点此处查看解决办法。 104 | 105 | #### 浏览器CORS/CSP策略拒绝第三方样式的加载 106 | 1. 部分站点因配置相关 CORS 策略,会使浏览器阻止对外部样式的获取(控制台 console 会看到相应报错,如:`No 'Access-Control-Allow-Origin' header is present on the requested resource.`),此时,可在扩展商店安装并开启 [Moesif Origin & CORS Changer](https://chromewebstore.google.com/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc)。 107 | 108 | 2. 在部分应用了 CSP 策略的站点,浏览器可能会阻止内部样式的加载和解析(控制台 console 会看到相应的报错,如:`Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'".`),此时,可在扩展商店安装并开启 [Allow CSP: Content-Security-Policy](https://chromewebstore.google.com/detail/allow-csp-content-securit/hnojoemndpdjofcdaonbefcfecpjfflh) 109 | 110 | 3. 使用其他CSP扩展也可解决此问题,如介意安全问题或有其他顾虑,请按以下方法关闭该功能: 111 | - 在**字体渲染设置界面**内取消勾选**视口修正**选项,或将**字体缩放**设置为`1.0`后保存为独享数据。 112 | - 在**高级核心功能设置**中单独关闭**视口单位修正**选项,或直接关闭**字体缩放功能**。(全局关闭) 113 |
114 | 115 | - **未知情况:** 如遇到其他状况下的样式异常、坐标偏移,或其他相关问题,请及时向我[反馈](https://github.com/F9y4ng/GreasyFork-Scripts/issues)。 116 | 117 | --- 118 | 119 | ## 优雅的搜索引擎助手 [`Google & Baidu Switcher.user.js`](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/Google%20%26%20Baidu%20Switcher.user.js) 120 | 121 | 简介:“优雅的搜索引擎助手”方便用户在不同的搜索引擎之间跳转;支持自定义常用搜索引擎、关键词高亮渲染;还提供去除搜索链接重定向、屏蔽搜索结果广告、使用关键词过滤搜索结果、和自动更新检测等高级功能;兼容如Baidu、Google、Bing、Duckduckgo、Yandex、Sogou、Qwant、Ecosia、You、Startpage、Brave、Yahoo、Yep、Swisscows、searXNG等多个搜索引擎。 122 | 123 | - [新手上路,请使用前仔细阅读脚本使用说明,以及当前页面内相关注意事项。](https://github.com/F9y4ng/GreasyFork-Scripts/wiki/%E4%BC%98%E9%9B%85%E7%9A%84%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E%E5%8A%A9%E6%89%8B) 124 | - 自动更新检测默认开启,如无更新提示需求,可在“**搜索引擎助手高级设置**”中关闭它。 125 | 126 | ### version 2025.05.03.1 - 更新日志: 【🔥 [安装此脚本](https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Google%20%26%20Baidu%20Switcher.user.js)】 127 | 128 | ```log 129 | @ 优化 baidu.com 跳转按钮样式。 130 | @ 优化 bing.com 搜索框的样式。 131 | @ 优化 You.com 跳转按钮的加载逻辑。 132 | @ 修正一些已知问题,优化代码,优化样式。 133 | ``` 134 | 135 | ### 最新功能介绍 136 | 137 | - 新增搜索结果关键词高效过滤功能,杜绝内容农场与垃圾信息。`New!` 138 | - 新增去除搜索结果及侧栏广告功能,优化广告屏蔽效率。 139 | - 新增自定义搜索引擎选取功能(包含:百度、Google、Bing、Duckduckgo、搜狗、Qwant、Yandex、360 搜索、头条搜索、百度开发者、Ecosia、Yahoo、You、Startpage、Brave、Yep、Swisscows、searXNG 搜索等常见的搜索引擎) 140 | - 新增搜索结果链接去重定向功能,优化隐私参数屏蔽功能。 141 | - 更智能的更新检测功能。 142 | 143 | ### 图标缓存的更新 144 | 访问[任意搜索引擎](https://www.baidu.com/s?wd=greasyfork&whoami=F9y4ng),在地址栏内向 URL 添加 `?whoami=F9y4ng` 或 `&whoami=F9y4ng`,开启临时调试模式,即可自动更新搜索引擎站点的icons;或等待图标缓存过期(十五天)后自动更新图标缓存。 145 | 146 | ### 重要说明 147 | 新版本“**自动更新**”功能默认开启,如不需要更新检测,请在脚本菜单“**搜索引擎助手高级设置**”中,关闭 **更新检测** 即可。 148 | 149 | - **反馈问题请注意**:反馈脚本错误或样式问题,请把**仅使用本脚本**情况下发生问题的**访问网址**、使用的**浏览器版本**、**脚本管理器版本**、**错误截图**、以及**操作流程**或**错误提示**发出来,你遇到的问题不一定能在我本地复现。 150 | 151 | - 一般来说,新版本发布将在**Github**进行,**GreasyFork**、**OpenUserJs**会自动同步。已开启自动更新检测功能的用户,脚本在访问搜索引擎时会进行自动更新。 152 | 153 | --- 154 | 155 | ## 自动关闭知乎登录提示 [`Autoclose Zhihu Login.user.js`](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/Autoclose%20Zhihu%20Login.user.js) 156 | 157 | 简介:自动关闭知乎登录提示,仅仅用于关闭自动弹出的登录提示,不干别的,未来也不会去干别的。 158 | 159 | ### version 2025.01.01.1 - 更新日志: 【🔥 [安装此脚本](https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Autoclose%20Zhihu%20Login.user.js)】 160 | 161 | ```log 162 | + 更新脚本版权日期信息。 163 | @ 优化更新功能代码。 164 | ``` 165 | 166 | ### 重要说明 167 | #### 浏览器版本要求: 168 | ``` 169 | Chrome >= 105; Edge >= 105; Safari >= 15.4; Firefox >= 103; Opera >= 91 170 | ``` 171 | 172 | #### 注意: 173 | * Firefox 使用时需在 `about:config` 中,将 `layout.css.has-selector.enabled` 改为 `true`. 174 | * Blink 内核浏览器 `105 > Version >= 101`,可进入 `chrome://flags/#enable-experimental-web-platform-features` 改为 `Enabled` 后跨版本使用. 175 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # [**GreasyFork-Scripts**](https://f9y4ng.github.io/GreasyFork-Scripts/index_en.html) - F9y4ng - [![WIKI](https://img.shields.io/badge/WIKI-GREASYFORK%20SCRIPTS-brightgreen.svg?logo=github "wiki")](https://github.com/F9y4ng/GreasyFork-Scripts/wiki/Home_EN) 2 | 3 | **页面语言** (**Language**) | [中文 (Chinese)](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/README.md) | 英语 (English) 4 | 5 | [![LICENSE](https://img.shields.io/badge/License-GPL--3.0--only-blue.svg?style=for-the-badge&logo=github "LICENSE")](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/LICENSE) [![LAST COMMIT](https://img.shields.io/github/last-commit/F9y4ng/GreasyFork-Scripts?color=blue&logo=github&style=for-the-badge "LAST COMMIT")](https://github.com/F9y4ng/GreasyFork-Scripts/commits/master) [![ISSUES](https://img.shields.io/github/issues/F9y4ng/GreasyFork-Scripts?logo=github&style=for-the-badge "ISSUES")](https://github.com/F9y4ng/GreasyFork-Scripts/issues) [![STARS](https://img.shields.io/github/stars/F9y4ng/GreasyFork-Scripts?color=brightgreen&logo=github&style=for-the-badge "STARS")](https://github.com/F9y4ng/GreasyFork-Scripts/stargazers) 6 | 7 | - Please install the **script-manager** extension first (e.g. Tampermonkey, Violentmonkey, Greasemonkey) before installing the script. 8 | - **Tampermonkey/Violentmonkey** is recommended for **Chrome / Firefox**, and **Tampermonkey** is recommended for **Safari.** 9 | - Using a script-manager such as **Adguard Desktop** or **Userscripts**, you can use **keyboard shortcuts** to call up the scripts menu. 10 | 11 | --- 12 | 13 | ### Join Telegram Channel (Channel Name: GreasyFork-Scripts) 14 | * Channel: https://t.me/+1e8Ebdy-mtdhY2Rl 15 | * If you like this project, please ⭐Start it above, Thanks for your support. 16 | * This channel for discussing userscripts for desktop browsers. 17 | 18 | --- 19 | 20 | ## Font Rendering (Customized) [`Font Rendering.user.js`](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/Font%20Rendering.user.js) 21 | 22 | **Introduction:** Enhance browser’s font rendering without installing MacType. This script offers a high-quality, customizable experience with default ‘Microsoft YaHei’ font. It provides advanced features like font rewriting, smoothing, scaling, stroking, shadowing, and filtering of special style elements. It supports global and personalized rendering, compatible with most mainstream browsers, script managers, and common userscripts & browser extensions. Configure parameters via the script manager icon or shortcuts. 23 | 24 | * [Before using, please read the introduction in Wiki and the related precautions on this page.](https://github.com/F9y4ng/GreasyFork-Scripts/wiki/Font-Rendering-(Customized)) 25 | * Please report script errors to [[Issues](https://github.com/F9y4ng/GreasyFork-Scripts/issues)], and report garbled and style issues to [[Discussions](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/categories/%E9%97%AE%E7%AD%94%E4%B8%93%E5%8C%BA-question-answer)]. 26 | * Back up your local data promptly and don't use backup files from unknown sources! 27 | 28 | ### version 2025.05.03.1 - Update log: 【🔥[Install this script](https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Font%20Rendering.user.js)】 29 | 30 | ```log 31 | @ Fixed @import issues in viewport units correction. 32 | @ Optimized Bold-Fix conflict detect compatibility. 33 | @ Improved predefined data support for pan-domain. 34 | @ Fixed some known issues, optimized code & style. 35 | ``` 36 | 37 | ### Please note the following before using the new version: 38 | 39 | - The new version of the script has a **built-in default font rendering style**, which is my local configuration and **may not work perfectly on your computer**. Therefore, **it is normal** for the first time to use it if the rendering effect does not reach the desired state. According to the configuration and settings of your own monitor, correct the relevant parameters through the script setting interface to achieve the best display effect. 40 | - When upgrading from an older version to the latest version, if there are some style issues, you can try to correct it by resetting the data to use the latest rules. however, It is not recommended that you use backup restore for major version (data rebuild) updates, and it is recommended to reconfigure the parameters, save them, and back up the new data again. 41 | - **Note:** Under Win10/Win11, regardless of high or low resolution, as long as the system or browser applies a zoom ratio of more than 150%, the best rendering effect can be obtained, which is determined by the default rendering mechanism of Windows. 42 | 43 |
44 | Click to view - How to deal with script delayed loading? 45 | 46 | **Temporary solutions for script loading delays, or styles not loading correctly:** 47 | * For **Tampermonkey v5.2 and later** (Manifest V3): Go to the **Dashboard**, enter the **Settings** tab, pull down to "**Security**", and change "**Content Script API:**" to `UserScripts API Dynamic`. 48 | 49 | * For **Tampermonkey v5.1.1 and older**: Go to the **Dashboard**, enter the **Settings** tab, scroll down to "**Experimental**", and change **the injection mode** to "**Instant**". 50 | 51 | * For **Violentmonkey**: Go to the **Dashboard**, enter the **Settings** tab, find and check "**Synchronous page mode**" in **Advanced - General**. 52 | 53 |
54 | 55 | ### Feedback on issues 56 | 57 | **Note 1:** Unknown compatibility errors may occur when using the `Beta, Dev, Canary, Nightly` and other test branches of the browser or script manager, and the script will not correct errors of the test version. Since there is a rare chance that the data will be initialized abnormally, **please back up your local data in time**. 58 | 59 | **Note 2:** To report script errors or style issues, please provide **the URL**, **the browser and version**, **the script manager and version**, **error page screenshot**, and **operation process** or **error prompt** (if any) where the problem occurs when **using this script only**, etc., because the problem you encountered may not be reproduced locally in me. 60 | 61 | * [Occasional updates: How to fix websites font style errors?](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/42) (Chinese) 62 | * [How to set custom English and Chinese fonts for the website?](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/83) (Chinese) 63 | * [How to correctly set font rendering parameters for different browsers?](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/160) (Chinese) 64 | 65 |
66 | Click to view - How to provide script error log? 67 | 68 | **Get and upload script error logs:** 69 | 70 | 1. Turn on the script debugging switch first: 71 | - v2023.04.08.1 or later, add `?whoami=F9y4ng` or `&whoami=F9y4ng` to the URL to enable debugging mode. 72 | - To use the old version change the code from `const IS_OPEN_DEBUG = false` to `true` at about line 54 and save. 73 | 2. Press **F12** in your browser to open the console, refresh, operate until the problem is reproduced, right-click in the console margin and select **Save As...**. 74 | 3. Use **Bug report** and upload the saved log file to [Github ISSUES](https://github.com/F9y4ng/GreasyFork-Scripts/issues)。 75 | 4. During daily use, do not turn on the script debugging switch to avoid slow script execution or page lagging. 76 | 77 |
78 | 79 | ### Adding custom fonts 80 | 81 | If you need to add custom fonts into the font library, please follow the [Help Instructions](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/64). The Chinese fonts in the built-in font library [Download](https://github.com/F9y4ng/GreasyFork-Scripts/discussions/46). 82 | 83 | If you want to add a new font, please add complete and accurate **font names in English and Chinese**, and **PostScript names** into the customized font library in the preset format. 84 | 85 | The format is as follows: ```{"ch":"鸿蒙黑体", "en":"HarmonyOS Sans SC", "ps":"HarmonyOS_Sans_SC"}``` 86 | 87 |
88 | Click to view - How to add new fonts to the custom font library? 89 | 90 | **Notes on adding custom fonts:** 91 | 92 | * When adding new fonts, fonts with font-weight of **Standard/Regular** are generally accepted. please use font stroke settings to adjust the font weight and bold. 93 | * "ps:" indicates the PostScript name, which is an optional attribute. To ensure that the font takes effect globally, please fill in the "ps:" attribute as much as possible. 94 | * If the font does not have Chinese font name, please use the English font name or other language font name instead, and pay attention to the uniqueness of the name. 95 | 96 | When a new font is installed, be sure to **restart the browser** first and **rebuild the font-list cache** in the **advanced core settings** for it to take effect immediately. 97 | 98 | - Note 1: Editing and saving a custom font library will automatically trigger a rebuild of the font list's global cache, eliminating the need for additional manual processing. 99 | - Note 2: If you only install fonts defined by the built-in font library, you need to manually rebuild the global cache of the font list in the **Advanced Core Setting** after restarting the browser. 100 | 101 |
102 | 103 | ### Font scaling (experimental) 104 | 105 | Font scaling (experimental), **OFF by default**, turn on font scaling in the **Advanced core settings**. 106 | 107 | - **KNOWN ISSUES I:** Due to the compatibility of Firefox (Gecko version < 126) and Greasemonkey/Userscripts extentions, only the internal coordinate offset problem of the script has been fixed, but it will be insufficiently compatible with some website styles and functions, so please use it according to your needs and discretion. **Strongly recommended**: Use Firefox's self-scaling feature (`Ctrl++`, `Ctrl+-`) instead of this experimental feature. 108 | 109 | - **KNOWN ISSUES II:** The fix for viewport units `vw, vh, vmin, vmax` has been completed, solving the problem of inaccurate viewport unit lengths after font scaling. This feature is **experimental** and **OFF by default**, it can be turned on in the **Advanced Core Setting**. 110 | 111 |
112 | Click to view the solution to style anomalies after turning on viewport correction. 113 | 114 | **The browser CORS/CSP policy refuses the loading of third-party styles:** 115 | 116 | 1. In some sites, due to CORS policy, browsers may block access to external styles (console console will see corresponding errors, e.g. `No 'Access-Control-Allow-Origin' header is present on the requested resource.`), in this case, you can install and enable [Moesif Origin & CORS Changer](https://chromewebstore.google.com/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc) in the Extension Store. 117 | 2. In some sites where CSP policies are applied, the browser may prevent the loading and parsing of internal styles (the console will see corresponding errors, such as: `Refused to apply inline style because it violates the following Content Security Policy directive: "default -src 'self'".`), in this case, you can install and enable [Allow CSP: Content-Security-Policy](https://chromewebstore.google.com/detail/allow-csp-content-securit/hnojoemndpdjofcdaonbefcfecpjfflh) in the extension store. 118 | 3. This issue can also be resolved by using other CSP extensions, but if you are concerned about security issues or have other concerns, please turn off the feature as follows: 119 | 1. Uncheck the **fix VPU** option in the **Font Rendering Setting** Interface, or set the **Font Scaling** to `1.0` and save it as exclusive data. 120 | 2. Turn off the **Fix Viewport** feature separately, or simply turn off the **Font Scaling** feature directly in the **Advanced Core Setting**. (Global Off) 121 |
122 | 123 | - **UNKNOWN SITUATION:** If you encounter style anomalies, coordinate offsets, or other related problems in other situations, please send me [feedback](https://github.com/F9y4ng/GreasyFork-Scripts/issues). 124 | 125 | --- 126 | 127 | ## Search Engine Assistants [`Google & Baidu Switcher.user.js`](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/Google%20%26%20Baidu%20Switcher.user.js) 128 | 129 | **Introduction:** "Elegant search engine assistant" allows switching between engines; supports custom engines, keyword highlighting; offers redirect removal, ad blocking, keyword filtering, and auto-updates; compatible with Baidu, Google, Bing, Duckduckgo, Yandex, Sogou, Qwant, Ecosia, You, Startpage, Brave, Yahoo, Yep, Swisscows, searXNG and more. 130 | 131 | * [Read the instructions for using the script and the precautions on the page before use.](https://github.com/F9y4ng/GreasyFork-Scripts/wiki/Search-Engine-Assistant) 132 | * If you don't need to be prompted for updates, you can turn it off in the "**Advanced Feature Settings**". 133 | 134 | ### version 2025.05.03.1 - Update log: 【🔥[Install this script](https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Google%20%26%20Baidu%20Switcher.user.js)】 135 | 136 | ```log 137 | @ Optimized the style of baidu.com jump button. 138 | @ Optimized the style of bing.com search box. 139 | @ Improved loading logic of You.com jump button. 140 | @ Fixed some known issues, optimized code & style. 141 | ``` 142 | 143 | ### The latest feature introduction 144 | - Added a new high-efficiency keyword filtering function for search results to eliminate content farms and spam. `New` 145 | - Added the function of removing search results and sidebar ads to optimize ad blocking efficiency of ad blocking. 146 | - Added custom search engine selection function (including: Baidu, Google, Bing, Duckduckgo, Sogou, Qwant, Yandex, 360 Search, Toutiao Search, Baidu Developer, Ecosia, Yahoo, You, Startpage, Brave, Yep, Swisscows, SearXNG) 147 | - Added the anti-redirection function of search result links and optimized the masking function of privacy parameters. 148 | - Smarter update detection feature. 149 | 150 | ### Icon cache update 151 | Visit [any search engine](https://www.google.com/search?q=greasyfork&whoami=F9y4ng), add `?whoami=F9y4ng` or `&whoami=F9y4ng` to the URL in the address bar to enable temporary debugging mode, then you can automatically update the icons of the search engine site; or wait for the icon cache to expire (15 days) and then automatically renew the icon cache. 152 | 153 | ### Important notes 154 | The "**Automatic Update**" function is enabled by default. If you do not need it,, please turn off **Auto Update Detect** in the "**Advanced Feature Settings**" of the script menu. 155 | 156 | - **Feedback Issues**: Feedback script errors or style issues, please provide **the access URL**, **the browser and version**, **the script manager and version**, **error screenshot**, and **operation process** or **error prompt** (if any) where the problem occurs when **using this script only**, etc., because the problem you encountered may not be reproduced locally in me. 157 | 158 | - Generally, the new version will be released on **Github**, and **GreasyFork** and **OpenUserJs** will be automatically synchronized. For users who have turned on auto-update detection, scripts are automatically updated when they visit search engines. 159 | 160 | --- 161 | 162 | ## Autoclose Zhihu Login Prompt [`Autoclose Zhihu Login.user.js`](https://github.com/F9y4ng/GreasyFork-Scripts/blob/master/Autoclose%20Zhihu%20Login.user.js) 163 | 164 | **Introduction:** "Autoclose Zhihu Login Prompt" is only used to close the automatically pop-up login prompt. It does nothing else and will not do anything else in the future. 165 | 166 | ### version 2025.01.01.1 - Update log: 【🔥[Install this script](https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Autoclose%20Zhihu%20Login.user.js)】 167 | 168 | ```log 169 | + Updated script copyright date. 170 | @ Optimized and updated feature code. 171 | ``` 172 | 173 | ### Important 174 | #### Browser version requirements: 175 | ``` 176 | Chrome >= 105; Edge >= 105; Safari >= 15.4; Firefox >= 103; Opera >= 91 177 | ``` 178 | 179 | #### Notice: 180 | * When using Firefox, you need to change `layout.css.has-selector.enabled` to `true` in `about:config`. 181 | * For Blink kernel browser `105 > Version >= 101`, you can enter `chrome://flags/#enable-experimental-web-platform-features` and change it to `Enabled` for cross-version use. 182 | -------------------------------------------------------------------------------- /images/Font Rendering/Example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/Example.gif -------------------------------------------------------------------------------- /images/Font Rendering/Exmaple_en.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/Exmaple_en.gif -------------------------------------------------------------------------------- /images/Font Rendering/FR-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/FR-after.png -------------------------------------------------------------------------------- /images/Font Rendering/FR-before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/FR-before.png -------------------------------------------------------------------------------- /images/Font Rendering/VIP2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/VIP2.png -------------------------------------------------------------------------------- /images/Font Rendering/VIP2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/VIP2_en.png -------------------------------------------------------------------------------- /images/Font Rendering/VIP_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/VIP_en.png -------------------------------------------------------------------------------- /images/Font Rendering/additional fix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/additional fix.png -------------------------------------------------------------------------------- /images/Font Rendering/additional fix_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/additional fix_en.png -------------------------------------------------------------------------------- /images/Font Rendering/allow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/allow.png -------------------------------------------------------------------------------- /images/Font Rendering/backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/backup.png -------------------------------------------------------------------------------- /images/Font Rendering/backup_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/backup_en.png -------------------------------------------------------------------------------- /images/Font Rendering/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/console.png -------------------------------------------------------------------------------- /images/Font Rendering/console_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/console_en.png -------------------------------------------------------------------------------- /images/Font Rendering/curSavadate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/curSavadate.png -------------------------------------------------------------------------------- /images/Font Rendering/curSavadate_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/curSavadate_en.png -------------------------------------------------------------------------------- /images/Font Rendering/customMonospacedFontZone_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/customMonospacedFontZone_en.png -------------------------------------------------------------------------------- /images/Font Rendering/customMonospacedFont_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/customMonospacedFont_en.png -------------------------------------------------------------------------------- /images/Font Rendering/customfont_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/customfont_en.png -------------------------------------------------------------------------------- /images/Font Rendering/customfont_trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/customfont_trigger.png -------------------------------------------------------------------------------- /images/Font Rendering/customfontlibrary_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/customfontlibrary_en.png -------------------------------------------------------------------------------- /images/Font Rendering/customfonts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/customfonts.png -------------------------------------------------------------------------------- /images/Font Rendering/errorRep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/errorRep.png -------------------------------------------------------------------------------- /images/Font Rendering/errorReport_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/errorReport_en.png -------------------------------------------------------------------------------- /images/Font Rendering/exclude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/exclude.png -------------------------------------------------------------------------------- /images/Font Rendering/exclude_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/exclude_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fixshadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fixshadow.png -------------------------------------------------------------------------------- /images/Font Rendering/fixshadow_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fixshadow_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fontRewriteZone_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontRewriteZone_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fontRewrite_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontRewrite_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fontScaleSetZone_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontScaleSetZone_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fontScaleSet_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontScaleSet_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fontSelect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontSelect.png -------------------------------------------------------------------------------- /images/Font Rendering/fontSelect_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontSelect_en.png -------------------------------------------------------------------------------- /images/Font Rendering/fontlist.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontlist.gif -------------------------------------------------------------------------------- /images/Font Rendering/fontoverwrite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontoverwrite.png -------------------------------------------------------------------------------- /images/Font Rendering/fontrewritezone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontrewritezone.png -------------------------------------------------------------------------------- /images/Font Rendering/fontscaleset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontscaleset.png -------------------------------------------------------------------------------- /images/Font Rendering/fontscalesetzone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/fontscalesetzone.png -------------------------------------------------------------------------------- /images/Font Rendering/include.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/include.png -------------------------------------------------------------------------------- /images/Font Rendering/includePan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/includePan.png -------------------------------------------------------------------------------- /images/Font Rendering/includePan_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/includePan_en.png -------------------------------------------------------------------------------- /images/Font Rendering/include_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/include_en.png -------------------------------------------------------------------------------- /images/Font Rendering/insertFonts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/insertFonts.png -------------------------------------------------------------------------------- /images/Font Rendering/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/loading.gif -------------------------------------------------------------------------------- /images/Font Rendering/manageExclude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/manageExclude.png -------------------------------------------------------------------------------- /images/Font Rendering/manageExclude_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/manageExclude_en.png -------------------------------------------------------------------------------- /images/Font Rendering/menus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/menus.png -------------------------------------------------------------------------------- /images/Font Rendering/menus2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/menus2.png -------------------------------------------------------------------------------- /images/Font Rendering/menus2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/menus2_en.png -------------------------------------------------------------------------------- /images/Font Rendering/menus_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/menus_en.png -------------------------------------------------------------------------------- /images/Font Rendering/monospace_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/monospace_custom.png -------------------------------------------------------------------------------- /images/Font Rendering/notallow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/notallow.png -------------------------------------------------------------------------------- /images/Font Rendering/personalsetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/personalsetting.png -------------------------------------------------------------------------------- /images/Font Rendering/personalsetting_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/personalsetting_en.png -------------------------------------------------------------------------------- /images/Font Rendering/predefined-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/predefined-en.png -------------------------------------------------------------------------------- /images/Font Rendering/predefined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/predefined.png -------------------------------------------------------------------------------- /images/Font Rendering/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/preview.png -------------------------------------------------------------------------------- /images/Font Rendering/preview_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/preview_en.png -------------------------------------------------------------------------------- /images/Font Rendering/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/reset.png -------------------------------------------------------------------------------- /images/Font Rendering/reset_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/reset_en.png -------------------------------------------------------------------------------- /images/Font Rendering/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/save.png -------------------------------------------------------------------------------- /images/Font Rendering/saveData_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/saveData_en.png -------------------------------------------------------------------------------- /images/Font Rendering/save_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/save_en.png -------------------------------------------------------------------------------- /images/Font Rendering/save_monospace_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/save_monospace_custom.png -------------------------------------------------------------------------------- /images/Font Rendering/save_monospace_custom_valid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/save_monospace_custom_valid.png -------------------------------------------------------------------------------- /images/Font Rendering/savedate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/savedate.png -------------------------------------------------------------------------------- /images/Font Rendering/scrollingbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/scrollingbar.png -------------------------------------------------------------------------------- /images/Font Rendering/scrollingbar_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/scrollingbar_en.png -------------------------------------------------------------------------------- /images/Font Rendering/settingUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/settingUI.png -------------------------------------------------------------------------------- /images/Font Rendering/settingUI_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/settingUI_en.png -------------------------------------------------------------------------------- /images/Font Rendering/tm_manifestv3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/tm_manifestv3.png -------------------------------------------------------------------------------- /images/Font Rendering/vip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/vip.png -------------------------------------------------------------------------------- /images/Font Rendering/vm_manifestv3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Font Rendering/vm_manifestv3.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/360so.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/360so.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/allSiteIcons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/allSiteIcons.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/baidu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/baidu.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/bing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/bing.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/brave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/brave.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/config.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/config_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/config_en.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/console.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/console_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/console_en.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/customColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/customColor.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/customColor_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/customColor_en.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/dev.baidu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/dev.baidu.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/duckduckgo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/duckduckgo.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/ecosia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/ecosia.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/filter.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/filter_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/filter_en.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/google.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/list.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/list_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/list_en.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/menu.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/menu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/menu_en.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/qwant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/qwant.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/searxng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/searxng.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/sogou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/sogou.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/startpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/startpage.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/swisscows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/swisscows.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/toutiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/toutiao.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/yahoo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/yahoo.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/yandex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/yandex.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/yep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/yep.png -------------------------------------------------------------------------------- /images/Google & Baidu Switcher/you.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/F9y4ng/GreasyFork-Scripts/c2c9ffbe9f6990cfac37db29a06e00b8fe54fee4/images/Google & Baidu Switcher/you.png -------------------------------------------------------------------------------- /lib/frColorPicker.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name frColorPicker 3 | // @version 7.1.0 4 | // @author F9y4ng 5 | // @license GPL-3.0-only 6 | // @description ColorPicker for Font Rendering (Customized) 7 | // ==/UserScript== 8 | 9 | (function (p, A) { 10 | "object" === typeof module && "object" === typeof module.exports 11 | ? (module.exports = function (y) { 12 | if (!y.document) throw Error("No Document!"); 13 | return A(y); 14 | }) 15 | : A(p); 16 | })("undefined" !== typeof window ? window : this, function (p) { 17 | var A = (function () { 18 | var y = function (b) { 19 | var d = Math.random().toString(36).slice(2); 20 | return d.slice(0, b - 4).padEnd(b - 3, Math.random().toString(36).slice(2)) + "." + d.slice(-3); 21 | }, 22 | C = y(9), 23 | E = y(8), 24 | F = y(12), 25 | G = y(8), 26 | H = y(7), 27 | B; 28 | a: { 29 | try { 30 | p.addEventListener("testPassive", null, { passive: !0 }), p.removeEventListener("testPassive", null, { passive: !0 }); 31 | } catch (b) { 32 | y = !1; 33 | break a; 34 | } 35 | y = !0; 36 | } 37 | var a = { 38 | initialized: !1, 39 | instances: [], 40 | readyQueue: [], 41 | register: function () { 42 | "undefined" !== typeof p && 43 | p.document && 44 | ("loading" === p.document.readyState 45 | ? p.document.addEventListener("DOMContentLoaded", a.pub.init, !1) 46 | : p.document.documentElement 47 | ? a.pub.init() 48 | : p.addEventListener("load", a.pub.init, !1)); 49 | }, 50 | getInstances: function () { 51 | for (var b = [], d = 0; d < a.instances.length; d += 1) a.instances[d] && a.instances[d].targetElement && b.push(a.instances[d]); 52 | return b; 53 | }, 54 | createEl: function (b) { 55 | b = p.document.createElement(b); 56 | a.setData(b, "gui", !0); 57 | return b; 58 | }, 59 | node: function (b) { 60 | if (!b) return null; 61 | if ("string" === typeof b) { 62 | var d = null; 63 | try { 64 | d = p.document.querySelector(b) || B.querySelector(b); 65 | } catch (e) { 66 | return null; 67 | } 68 | return d; 69 | } 70 | return a.isNode(b) ? b : null; 71 | }, 72 | isNode: function (b) { 73 | return "object" === typeof Node ? b instanceof Node : b && "object" === typeof b && "number" === typeof b.nodeType && "string" === typeof b.nodeName; 74 | }, 75 | nodeName: function (b) { 76 | return b && b.nodeName ? b.nodeName.toLowerCase() : !1; 77 | }, 78 | isTextInput: function (b) { 79 | return b && "input" === a.nodeName(b) && "text" === b.type.toLowerCase(); 80 | }, 81 | isPassiveEventSupported: y, 82 | hOP: Object.prototype.hasOwnProperty, 83 | dataProp: "_data_fr_colorpicker_", 84 | setData: function () { 85 | var b = arguments[0]; 86 | if (3 === arguments.length) { 87 | b = a.hOP.call(b, a.dataProp) ? b[a.dataProp] : (b[a.dataProp] = {}); 88 | var d = arguments[1]; 89 | b[d] = arguments[2]; 90 | return !0; 91 | } 92 | if (2 === arguments.length && "object" === typeof arguments[1]) { 93 | b = a.hOP.call(b, a.dataProp) ? b[a.dataProp] : (b[a.dataProp] = {}); 94 | var e = arguments[1]; 95 | for (d in e) a.hOP.call(e, d) && (b[d] = e[d]); 96 | return !0; 97 | } 98 | throw Error("Invalid arguments"); 99 | }, 100 | getData: function (b, d, e) { 101 | if (!a.hOP.call(b, a.dataProp)) 102 | if ("undefined" !== typeof e) b[a.dataProp] = {}; 103 | else return; 104 | b = b[a.dataProp]; 105 | a.hOP.call(b, d) || "undefined" === typeof e || (b[d] = e); 106 | return b[d]; 107 | }, 108 | setDataAttr: function (b, d, e) { 109 | b.setAttribute("data-" + d, e); 110 | }, 111 | _attachedGroupEvents: {}, 112 | attachGroupEvent: function (b, d, e, g) { 113 | a.hOP.call(a._attachedGroupEvents, b) || (a._attachedGroupEvents[b] = []); 114 | a._attachedGroupEvents[b].push([d, e, g]); 115 | d.addEventListener(e, g, !1); 116 | }, 117 | detachGroupEvents: function (b) { 118 | if (a.hOP.call(a._attachedGroupEvents, b)) { 119 | for (var d = 0; d < a._attachedGroupEvents[b].length; d += 1) { 120 | var e = a._attachedGroupEvents[b][d]; 121 | e[0].removeEventListener(e[1], e[2], !1); 122 | } 123 | delete a._attachedGroupEvents[b]; 124 | } 125 | }, 126 | preventDefault: function (b) { 127 | b.preventDefault && b.preventDefault(); 128 | b.returnValue = !1; 129 | }, 130 | triggerEvent: function (b, d, e, g) { 131 | if (b) { 132 | if ("function" === typeof Event) var l = new Event(d, { bubbles: e, cancelable: g }); 133 | else (l = p.document.createEvent("Event")), l.initEvent(d, e, g); 134 | if (!l) return !1; 135 | a.setData(l, "internal", !0); 136 | b.dispatchEvent(l); 137 | return !0; 138 | } 139 | }, 140 | triggerInputEvent: function (b, d, e, g) { 141 | b && a.isTextInput(b) && a.triggerEvent(b, d, e, g); 142 | }, 143 | strList: function (b) { 144 | return b ? b.replace(/^\s+|\s+$/g, "").split(/\s+/) : []; 145 | }, 146 | hasClass: function (b, d) { 147 | return d ? ("undefined" !== typeof b.classList ? b.classList.contains(d) : -1 != (" " + b.className.replace(/\s+/g, " ") + " ").indexOf(" " + d + " ")) : !1; 148 | }, 149 | addClass: function (b, d) { 150 | d = a.strList(d); 151 | if ("undefined" !== typeof b.classList) for (var e = 0; e < d.length; e += 1) b.classList.add(d[e]); 152 | else for (e = 0; e < d.length; e += 1) a.hasClass(b, d[e]) || (b.className += (b.className ? " " : "") + d[e]); 153 | }, 154 | removeClass: function (b, d) { 155 | d = a.strList(d); 156 | if ("undefined" !== typeof b.classList) for (var e = 0; e < d.length; e += 1) b.classList.remove(d[e]); 157 | else for (e = 0; e < d.length; e += 1) b.className = b.className.replace(new RegExp("^\\s*" + d[e] + "\\s*|\\s*" + d[e] + "\\s*$|\\s+" + d[e] + "(\\s+)", "g"), "$1"); 158 | }, 159 | getCompStyle: function (b) { 160 | return b instanceof ShadowRoot ? {} : (b = p.getComputedStyle ? p.getComputedStyle(b) : b.currentStyle) ? b : {}; 161 | }, 162 | setStyle: function (b, d, e, g) { 163 | e = e ? "important" : ""; 164 | var l = null, 165 | k; 166 | for (k in d) 167 | if (a.hOP.call(d, k)) { 168 | var n = null; 169 | null === d[k] 170 | ? (l || (l = a.getData(b, "origStyle")), l && a.hOP.call(l, k) && (n = l[k])) 171 | : (g && (l || (l = a.getData(b, "origStyle", {})), a.hOP.call(l, k) || (l[k] = b.style[k])), (n = d[k])); 172 | null !== n && b.style.setProperty(k, n, e); 173 | } 174 | }, 175 | hexColor: function (b, d, e) { 176 | return "#" + (("0" + Math.round(b).toString(16)).slice(-2) + ("0" + Math.round(d).toString(16)).slice(-2) + ("0" + Math.round(e).toString(16)).slice(-2)).toUpperCase(); 177 | }, 178 | hexaColor: function (b, d, e, g) { 179 | return ( 180 | "#" + 181 | ( 182 | ("0" + Math.round(b).toString(16)).slice(-2) + 183 | ("0" + Math.round(d).toString(16)).slice(-2) + 184 | ("0" + Math.round(e).toString(16)).slice(-2) + 185 | ("0" + Math.round(255 * g).toString(16)).slice(-2) 186 | ).toUpperCase() 187 | ); 188 | }, 189 | rgbColor: function (b, d, e) { 190 | return "rgb(" + Math.round(b) + "," + Math.round(d) + "," + Math.round(e) + ")"; 191 | }, 192 | rgbaColor: function (b, d, e, g) { 193 | return "rgba(" + Math.round(b) + "," + Math.round(d) + "," + Math.round(e) + "," + Math.round(100 * ("undefined" === typeof g || null === g ? 1 : g)) / 100 + ")"; 194 | }, 195 | setBorderRadius: function (b, d) { 196 | a.setStyle(b, { "border-radius": d || "0" }); 197 | }, 198 | getElementPos: function (b, d) { 199 | var e = p.frDOMRects; 200 | "undefined" === typeof e && (e = { toggle: !1, cur: 1, prev: 1 }); 201 | e = e.toggle ? e.cur : 1; 202 | var g = b.getBoundingClientRect(); 203 | b = g.left * e; 204 | g = g.top * e; 205 | d || ((d = a.getViewPos()), (b += d[0] * e), (g += d[1] * e)); 206 | return [b, g]; 207 | }, 208 | getElementSize: function (b) { 209 | return [b.offsetWidth, b.offsetHeight]; 210 | }, 211 | getAbsPointerPos: function (b) { 212 | var d = p.frDOMRects; 213 | "undefined" === typeof d && (d = { toggle: !1, cur: 1, prev: 1 }); 214 | var e = 0, 215 | g = 0; 216 | "undefined" !== typeof b.changedTouches && b.changedTouches.length 217 | ? ((e = b.changedTouches[0].x * d.cur), (g = b.changedTouches[0].y * d.cur)) 218 | : "number" === typeof b.x && ((e = b.x * d.cur), (g = b.y * d.cur)); 219 | return { x: e, y: g }; 220 | }, 221 | getRelPointerPos: function (b) { 222 | var d = p.frDOMRects; 223 | "undefined" === typeof d && (d = { toggle: !1, cur: 1, prev: 1 }); 224 | var e = (b.target || b.srcElement).getBoundingClientRect(), 225 | g = d.toggle ? d.cur : 1, 226 | l = 0, 227 | k = 0; 228 | "undefined" !== typeof b.changedTouches && b.changedTouches.length 229 | ? ((l = b.changedTouches[0].x * d.cur), (k = b.changedTouches[0].y * d.cur)) 230 | : "number" === typeof b.x && ((l = b.x * d.cur), (k = b.y * d.cur)); 231 | return { x: l - e.left * g, y: k - e.top * g }; 232 | }, 233 | getViewPos: function () { 234 | var b = p.document.documentElement; 235 | return [(p.pageXOffset || b.scrollLeft) - (b.clientLeft || 0), (p.pageYOffset || b.scrollTop) - (b.clientTop || 0)]; 236 | }, 237 | getViewSize: function () { 238 | var b = p.document.documentElement; 239 | return [p.innerWidth || b.clientWidth, p.innerHeight || b.clientHeight]; 240 | }, 241 | RGB_HSV: function (b, d, e) { 242 | b /= 255; 243 | d /= 255; 244 | e /= 255; 245 | var g = Math.min(Math.min(b, d), e), 246 | l = Math.max(Math.max(b, d), e), 247 | k = l - g; 248 | if (0 === k) return [null, 0, 100 * l]; 249 | b = b === g ? 3 + (e - d) / k : d === g ? 5 + (b - e) / k : 1 + (d - b) / k; 250 | return [60 * (6 === b ? 0 : b), (k / l) * 100, 100 * l]; 251 | }, 252 | HSV_RGB: function (b, d, e) { 253 | e = (e / 100) * 255; 254 | if (null === b) return [e, e, e]; 255 | b /= 60; 256 | d /= 100; 257 | var g = Math.floor(b), 258 | l = e * (1 - d); 259 | b = e * (1 - d * (g % 2 ? b - g : 1 - (b - g))); 260 | switch (g) { 261 | case 6: 262 | case 0: 263 | return [e, b, l]; 264 | case 1: 265 | return [b, e, l]; 266 | case 2: 267 | return [l, e, b]; 268 | case 3: 269 | return [l, b, e]; 270 | case 4: 271 | return [b, l, e]; 272 | case 5: 273 | return [e, l, b]; 274 | } 275 | }, 276 | parseColorString: function (b) { 277 | var d = { rgba: null, format: null }, 278 | e; 279 | if ((e = b.match(/^\W*([0-9A-F]{3,8})\W*$|^currentcolor$/i))) { 280 | if ("currentcolor" === e[0].toLowerCase()) return (d.format = "hexa"), (d.rgba = [255, 255, 255, 255]), d; 281 | if (8 === e[1].length) 282 | (d.format = "hexa"), (d.rgba = [parseInt(e[1].slice(0, 2), 16), parseInt(e[1].slice(2, 4), 16), parseInt(e[1].slice(4, 6), 16), parseInt(e[1].slice(6, 8), 16) / 255]); 283 | else if (6 === e[1].length) (d.format = "hex"), (d.rgba = [parseInt(e[1].slice(0, 2), 16), parseInt(e[1].slice(2, 4), 16), parseInt(e[1].slice(4, 6), 16), 1]); 284 | else if (3 === e[1].length) 285 | (d.format = "hex"), (d.rgba = [parseInt(e[1].charAt(0) + e[1].charAt(0), 16), parseInt(e[1].charAt(1) + e[1].charAt(1), 16), parseInt(e[1].charAt(2) + e[1].charAt(2), 16), 1]); 286 | else return !1; 287 | return d; 288 | } 289 | if ((e = b.match(/^\W*rgba?\(([^)]*)\)\W*$/i))) { 290 | b = e[1].split(","); 291 | e = /^\s*(\d+|\d*\.\d+|\d+\.\d*)\s*$/; 292 | var g, l, k, n; 293 | if (3 <= b.length && (g = b[0].match(e)) && (l = b[1].match(e)) && (k = b[2].match(e))) 294 | return ( 295 | (d.format = "rgb"), 296 | (d.rgba = [parseFloat(g[1]) || 0, parseFloat(l[1]) || 0, parseFloat(k[1]) || 0, 1]), 297 | 4 <= b.length && (n = b[3].match(e)) && ((d.format = "rgba"), (d.rgba[3] = parseFloat(n[1]) || 0)), 298 | d 299 | ); 300 | } 301 | return !1; 302 | }, 303 | isAlphaFormat: function (b) { 304 | switch (b.toLowerCase()) { 305 | case "hexa": 306 | case "rgba": 307 | return !0; 308 | } 309 | return !1; 310 | }, 311 | scaleCanvasForHighDPR: function (b) { 312 | var d = p.devicePixelRatio || 1; 313 | b.width *= d; 314 | b.height *= d; 315 | b.getContext("2d").scale(d, d); 316 | }, 317 | genColorPreviewCanvas: function (b, d, e, g) { 318 | var l = Math.round(a.pub.previewSeparator.length), 319 | k = a.pub.chessboardSize, 320 | n = a.pub.chessboardColor1, 321 | q = a.pub.chessboardColor2; 322 | e = e ? e : 2 * k; 323 | var t = 2 * k, 324 | u = a.createEl("canvas"), 325 | v = u.getContext("2d"); 326 | u.width = e; 327 | u.height = t; 328 | g && a.scaleCanvasForHighDPR(u); 329 | v.fillStyle = n; 330 | v.fillRect(0, 0, e, t); 331 | v.fillStyle = q; 332 | for (g = 0; g < e; g += 2 * k) v.fillRect(g, 0, k, k), v.fillRect(g + k, k, k, k); 333 | b && ((v.fillStyle = b), v.fillRect(0, 0, e, t)); 334 | b = null; 335 | switch (d) { 336 | case "left": 337 | b = 0; 338 | v.clearRect(0, 0, l / 2, t); 339 | break; 340 | case "right": 341 | (b = e - l), v.clearRect(e - l / 2, 0, l / 2, t); 342 | } 343 | if (null !== b) 344 | for (v.lineWidth = 1, d = 0; d < a.pub.previewSeparator.length; d += 1) 345 | v.beginPath(), (v.strokeStyle = a.pub.previewSeparator[d]), v.moveTo(0.5 + b + d, 0), v.lineTo(0.5 + b + d, t), v.stroke(); 346 | return { canvas: u, width: e, height: t }; 347 | }, 348 | redrawPosition: function () { 349 | if (a.picker && a.picker.owner) { 350 | var b = a.picker.owner; 351 | if (b.fixed) { 352 | var d = a.getElementPos(b.targetElement, !0); 353 | var e = [0, 0]; 354 | } else (d = a.getElementPos(b.targetElement)), (e = a.getViewPos()); 355 | var g = a.getElementSize(b.targetElement), 356 | l = a.getViewSize(), 357 | k = a.getPickerDims(b), 358 | n = [k.borderW, k.borderH]; 359 | switch (b.position.toLowerCase()) { 360 | case "left": 361 | k = 1; 362 | var q = 0; 363 | var t = -1; 364 | break; 365 | case "right": 366 | k = 1; 367 | q = 0; 368 | t = 1; 369 | break; 370 | case "top": 371 | k = 0; 372 | q = 1; 373 | t = -1; 374 | break; 375 | default: 376 | (k = 0), (t = q = 1); 377 | } 378 | var u = (g[q] + n[q]) / 2; 379 | d = b.smartPosition 380 | ? [ 381 | -e[k] + d[k] + n[k] > l[k] ? (-e[k] + d[k] + g[k] / 2 > l[k] / 2 && 0 <= d[k] + g[k] - n[k] ? d[k] + g[k] - n[k] : d[k]) : d[k], 382 | -e[q] + d[q] + g[q] + n[q] - u + u * t > l[q] 383 | ? -e[q] + d[q] + g[q] / 2 > l[q] / 2 && 0 <= d[q] + g[q] - u - u * t 384 | ? d[q] + g[q] - u - u * t - 4 385 | : d[q] + g[q] - u + u * t + 4 386 | : 0 <= d[q] + g[q] - u + u * t 387 | ? d[q] + g[q] - u + u * t - 4 388 | : d[q] + g[q] - u - u * t + 4, 389 | ] 390 | : [d[k], d[q] + g[q] - u + u * t - 4]; 391 | a._drawPosition(d[k], d[q], b.fixed ? "fixed" : "absolute"); 392 | } 393 | }, 394 | _drawPosition: function (b, d, e) { 395 | a.picker.wrap.style.left = b + "px"; 396 | a.picker.wrap.style.top = d + "px"; 397 | a.picker.wrap.style.position = e; 398 | }, 399 | getPickerDims: function (b) { 400 | var d = 2 * b.controlBorderWidth + b.width, 401 | e = 2 * b.controlBorderWidth + b.height, 402 | g = 2 * b.controlBorderWidth + 2 * a.getControlPadding(b) + b.sliderSize; 403 | a.getSliderChannel(b) && (d += g); 404 | b.hasAlphaChannel() && (d += g); 405 | g = d + 2 * b.padding; 406 | var l = e + 2 * b.padding; 407 | return { 408 | contentW: d, 409 | contentH: e, 410 | paddedW: g, 411 | paddedH: l, 412 | borderW: g + 2 * b.borderWidth, 413 | borderH: l + 2 * b.borderWidth, 414 | }; 415 | }, 416 | getControlPadding: function (b) { 417 | return Math.max(b.padding / 2, 2 * b.pointerBorderWidth + b.pointerThickness - b.controlBorderWidth); 418 | }, 419 | getPadYChannel: function (b) { 420 | switch (b.mode.charAt(1).toLowerCase()) { 421 | case "v": 422 | return "v"; 423 | } 424 | return "s"; 425 | }, 426 | getSliderChannel: function (b) { 427 | if (2 < b.mode.length) 428 | switch (b.mode.charAt(2).toLowerCase()) { 429 | case "s": 430 | return "s"; 431 | case "v": 432 | return "v"; 433 | } 434 | return null; 435 | }, 436 | triggerCallback: function (b, d) { 437 | if (b[d]) { 438 | var e = null; 439 | if ("string" === typeof b[d]) 440 | try { 441 | e = new Function(b[d]); 442 | } catch (g) { 443 | console.error(g); 444 | } 445 | else e = b[d]; 446 | e && e.call(b); 447 | } 448 | }, 449 | triggerGlobal: function (b) { 450 | for (var d = a.getInstances(), e = 0; e < d.length; e += 1) d[e].trigger(b); 451 | }, 452 | _pointerMoveEvent: { mouse: "mousemove", touch: "touchmove" }, 453 | _pointerEndEvent: { mouse: "mouseup", touch: "touchend" }, 454 | _pointerOrigin: null, 455 | onWindowResize: function (b) { 456 | a.redrawPosition(); 457 | }, 458 | onWindowScroll: function (b) { 459 | a.redrawPosition(); 460 | }, 461 | onConfigIfMouseDown: function (b) { 462 | b = b.composedPath()[0] || b.target || b.srcElement; 463 | b.frcp && b.frcp instanceof a.pub 464 | ? b.frcp.showOnClick && !b.disabled && (a.picker && a.picker.owner ? a.picker.owner.tryHide() : b.frcp.show()) 465 | : a.picker && a.picker.owner && a.picker.owner.tryHide(); 466 | }, 467 | onDocumentMouseDown: function (b) { 468 | if (!b.target || !b.target.nodeName || "fr-configure" !== b.target.nodeName.toLowerCase()) { 469 | var d = b.target || b.srcElement; 470 | if (a.getData(d, "gui")) { 471 | if (a.getData(d, "control")) a.onControlPointerStart(b, d, a.getData(d, "control"), "mouse"); 472 | } else a.picker && a.picker.owner && a.picker.owner.tryHide(); 473 | } 474 | }, 475 | onPickerTouchStart: function (b) { 476 | var d = b.target || b.srcElement; 477 | if (a.getData(d, "control")) a.onControlPointerStart(b, d, a.getData(d, "control"), "touch"); 478 | }, 479 | onControlPointerStart: function (b, d, e, g) { 480 | var l = a.getData(d, "instance"); 481 | a.preventDefault(b); 482 | var k = function (t, u) { 483 | a.attachGroupEvent("drag", t, a._pointerMoveEvent[g], a.onDocumentPointerMove(b, d, e, g, u)); 484 | a.attachGroupEvent("drag", t, a._pointerEndEvent[g], a.onDocumentPointerEnd(b, d, e, g)); 485 | }; 486 | k(p.document, [0, 0]); 487 | if (p.parent && p.frameElement) { 488 | var n = p.frDOMRects; 489 | "undefined" === typeof n && (n = { toggle: !1, cur: 1, prev: 1 }); 490 | n = n.toggle ? n.cur : 1; 491 | var q = p.frameElement.getBoundingClientRect(); 492 | k(p.parent.window.document, [-q.left * n, -q.top * n]); 493 | } 494 | k = a.getAbsPointerPos(b); 495 | n = a.getRelPointerPos(b); 496 | a._pointerOrigin = { x: k.x - n.x, y: k.y - n.y }; 497 | switch (e) { 498 | case "pad": 499 | "v" === a.getSliderChannel(l) && 0 === l.channels.v && l.fromHSVA(null, null, 100, null); 500 | a.setPad(l, b, 0, 0); 501 | break; 502 | case "sld": 503 | a.setSld(l, b, 0); 504 | break; 505 | case "asld": 506 | a.setASld(l, b, 0); 507 | } 508 | l.trigger("input"); 509 | }, 510 | onDocumentPointerMove: function (b, d, e, g, l) { 511 | return function (k) { 512 | var n = a.getData(d, "instance"); 513 | switch (e) { 514 | case "pad": 515 | a.setPad(n, k, l[0], l[1]); 516 | break; 517 | case "sld": 518 | a.setSld(n, k, l[1]); 519 | break; 520 | case "asld": 521 | a.setASld(n, k, l[1]); 522 | } 523 | n.trigger("input"); 524 | }; 525 | }, 526 | onDocumentPointerEnd: function (b, d, e, g) { 527 | return function (l) { 528 | l = a.getData(d, "instance"); 529 | a.detachGroupEvents("drag"); 530 | l.trigger("input"); 531 | l.trigger("change"); 532 | }; 533 | }, 534 | setPad: function (b, d, e, g) { 535 | d = a.getAbsPointerPos(d); 536 | e = (360 / (b.width - 1)) * (e + d.x - a._pointerOrigin.x - b.padding - b.controlBorderWidth); 537 | g = 100 - (100 / (b.height - 1)) * (g + d.y - a._pointerOrigin.y - b.padding - b.controlBorderWidth); 538 | switch (a.getPadYChannel(b)) { 539 | case "s": 540 | b.fromHSVA(e, g, null, null); 541 | break; 542 | case "v": 543 | b.fromHSVA(e, null, g, null); 544 | } 545 | }, 546 | setSld: function (b, d, e) { 547 | d = a.getAbsPointerPos(d); 548 | e = 100 - (100 / (b.height - 1)) * (e + d.y - a._pointerOrigin.y - b.padding - b.controlBorderWidth); 549 | switch (a.getSliderChannel(b)) { 550 | case "s": 551 | b.fromHSVA(null, e, null, null); 552 | break; 553 | case "v": 554 | b.fromHSVA(null, null, e, null); 555 | } 556 | }, 557 | setASld: function (b, d, e) { 558 | d = a.getAbsPointerPos(d); 559 | e = 1 - (1 / (b.height - 1)) * (e + d.y - a._pointerOrigin.y - b.padding - b.controlBorderWidth); 560 | 1 > e && ((d = b.getFormat()), "any" !== b.format.toLowerCase() || a.isAlphaFormat(d) || b._setFormat("hex" === d ? "hexa" : "rgba")); 561 | b.fromHSVA(null, null, null, e); 562 | }, 563 | createPadCanvas: function () { 564 | var b = { elm: null, draw: null }, 565 | d = a.createEl("canvas"), 566 | e = d.getContext("2d"); 567 | b.elm = d; 568 | b.draw = function (g, l, k) { 569 | d.width = g; 570 | d.height = l; 571 | e.clearRect(0, 0, d.width, d.height); 572 | g = e.createLinearGradient(0, 0, d.width, 0); 573 | g.addColorStop(0, "#F00"); 574 | g.addColorStop(1 / 6, "#FF0"); 575 | g.addColorStop(2 / 6, "#0F0"); 576 | g.addColorStop(0.5, "#0FF"); 577 | g.addColorStop(4 / 6, "#00F"); 578 | g.addColorStop(5 / 6, "#F0F"); 579 | g.addColorStop(1, "#F00"); 580 | e.fillStyle = g; 581 | e.fillRect(0, 0, d.width, d.height); 582 | g = e.createLinearGradient(0, 0, 0, d.height); 583 | switch (k.toLowerCase()) { 584 | case "s": 585 | g.addColorStop(0, "rgba(255,255,255,0)"); 586 | g.addColorStop(1, "rgba(255,255,255,1)"); 587 | break; 588 | case "v": 589 | g.addColorStop(0, "rgba(0,0,0,0)"), g.addColorStop(1, "rgba(0,0,0,1)"); 590 | } 591 | e.fillStyle = g; 592 | e.fillRect(0, 0, d.width, d.height); 593 | }; 594 | return b; 595 | }, 596 | createSliderGradient: function () { 597 | var b = { elm: null, draw: null }, 598 | d = a.createEl("canvas"), 599 | e = d.getContext("2d"); 600 | b.elm = d; 601 | b.draw = function (g, l, k, n) { 602 | d.width = g; 603 | d.height = l; 604 | e.clearRect(0, 0, d.width, d.height); 605 | g = e.createLinearGradient(0, 0, 0, d.height); 606 | g.addColorStop(0, k); 607 | g.addColorStop(1, n); 608 | e.fillStyle = g; 609 | e.fillRect(0, 0, d.width, d.height); 610 | }; 611 | return b; 612 | }, 613 | createASliderGradient: function () { 614 | var b = { elm: null, draw: null }, 615 | d = a.createEl("canvas"), 616 | e = d.getContext("2d"); 617 | b.elm = d; 618 | b.draw = function (g, l, k) { 619 | d.width = g; 620 | d.height = l; 621 | e.clearRect(0, 0, d.width, d.height); 622 | g = d.width / 2; 623 | l = a.pub.chessboardColor2; 624 | e.fillStyle = a.pub.chessboardColor1; 625 | e.fillRect(0, 0, d.width, d.height); 626 | if (0 < g) for (var n = 0; n < d.height; n += 2 * g) (e.fillStyle = l), e.fillRect(0, n, g, g), e.fillRect(g, n + g, g, g); 627 | g = e.createLinearGradient(0, 0, 0, d.height); 628 | g.addColorStop(0, k); 629 | g.addColorStop(1, "rgba(0,0,0,0)"); 630 | e.fillStyle = g; 631 | e.fillRect(0, 0, d.width, d.height); 632 | }; 633 | return b; 634 | }, 635 | flags: { leaveValue: 1, leaveAlpha: 2, leavePreview: 4 }, 636 | enumOpts: { 637 | format: "auto any hex hexa rgb rgba".split(" "), 638 | previewPosition: ["left", "right"], 639 | mode: ["hsv", "hvs", "hs", "hv"], 640 | position: ["left", "right", "top", "bottom"], 641 | alphaChannel: ["auto", !0, !1], 642 | }, 643 | pub: function (b, d, e) { 644 | function g(c, h) { 645 | if ("string" !== typeof c) throw Error("Invalid value for option name: " + c); 646 | if (a.hOP.call(a.enumOpts, c) && ("string" === typeof h && (h = h.toLowerCase()), -1 === a.enumOpts[c].indexOf(h))) throw Error("Option '" + c + "' has invalid value: " + h); 647 | var m = "set__" + c; 648 | if ("function" === typeof f[m]) return f[m](h), !0; 649 | if (c in f) return (f[c] = h), !0; 650 | throw Error("Unrecognized configuration option: " + c); 651 | } 652 | function l() { 653 | f._processParentElementsInDOM(); 654 | a.picker || 655 | ((a.picker = { 656 | owner: null, 657 | wrap: a.createEl("fr-colorpicker"), 658 | box: a.createEl("div"), 659 | boxB: a.createEl("div"), 660 | pad: a.createEl("div"), 661 | padB: a.createEl("div"), 662 | padM: a.createEl("div"), 663 | padCanvas: a.createPadCanvas(), 664 | cross: a.createEl("div"), 665 | crossBY: a.createEl("div"), 666 | crossBX: a.createEl("div"), 667 | crossLY: a.createEl("div"), 668 | crossLX: a.createEl("div"), 669 | sld: a.createEl("div"), 670 | sldB: a.createEl("div"), 671 | sldM: a.createEl("div"), 672 | sldGrad: a.createSliderGradient(), 673 | sldPtrS: a.createEl("div"), 674 | sldPtrIB: a.createEl("div"), 675 | sldPtrMB: a.createEl("div"), 676 | sldPtrOB: a.createEl("div"), 677 | asld: a.createEl("div"), 678 | asldB: a.createEl("div"), 679 | asldM: a.createEl("div"), 680 | asldGrad: a.createASliderGradient(), 681 | asldPtrS: a.createEl("div"), 682 | asldPtrIB: a.createEl("div"), 683 | asldPtrMB: a.createEl("div"), 684 | asldPtrOB: a.createEl("div"), 685 | }), 686 | a.picker.pad.appendChild(a.picker.padCanvas.elm), 687 | a.picker.padB.appendChild(a.picker.pad), 688 | a.picker.cross.appendChild(a.picker.crossBY), 689 | a.picker.cross.appendChild(a.picker.crossBX), 690 | a.picker.cross.appendChild(a.picker.crossLY), 691 | a.picker.cross.appendChild(a.picker.crossLX), 692 | a.picker.padB.appendChild(a.picker.cross), 693 | a.picker.box.appendChild(a.picker.padB), 694 | a.picker.box.appendChild(a.picker.padM), 695 | a.picker.sld.appendChild(a.picker.sldGrad.elm), 696 | a.picker.sldB.appendChild(a.picker.sld), 697 | a.picker.sldB.appendChild(a.picker.sldPtrOB), 698 | a.picker.sldPtrOB.appendChild(a.picker.sldPtrMB), 699 | a.picker.sldPtrMB.appendChild(a.picker.sldPtrIB), 700 | a.picker.sldPtrIB.appendChild(a.picker.sldPtrS), 701 | a.picker.box.appendChild(a.picker.sldB), 702 | a.picker.box.appendChild(a.picker.sldM), 703 | a.picker.asld.appendChild(a.picker.asldGrad.elm), 704 | a.picker.asldB.appendChild(a.picker.asld), 705 | a.picker.asldB.appendChild(a.picker.asldPtrOB), 706 | a.picker.asldPtrOB.appendChild(a.picker.asldPtrMB), 707 | a.picker.asldPtrMB.appendChild(a.picker.asldPtrIB), 708 | a.picker.asldPtrIB.appendChild(a.picker.asldPtrS), 709 | a.picker.box.appendChild(a.picker.asldB), 710 | a.picker.box.appendChild(a.picker.asldM), 711 | a.picker.boxB.appendChild(a.picker.box), 712 | a.picker.wrap.appendChild(a.picker.boxB), 713 | a.picker.wrap.addEventListener("touchstart", a.onPickerTouchStart, a.isPassiveEventSupported ? { passive: !1 } : !1)); 714 | var c = a.picker, 715 | h = !!a.getSliderChannel(f), 716 | m = f.hasAlphaChannel(), 717 | r = a.getPickerDims(f), 718 | w = 2 * f.pointerBorderWidth + f.pointerThickness + 2 * f.crossSize, 719 | x = a.getControlPadding(f), 720 | I = Math.min(f.borderRadius, Math.round(f.padding * Math.PI)), 721 | D = f.padding + f.width + 2 * f.controlBorderWidth + x + (h ? f.sliderSize + 2 * x + 2 * f.controlBorderWidth : 0); 722 | c.wrap.className = F; 723 | c.wrap.style.clear = "both"; 724 | c.wrap.style.display = "block"; 725 | c.wrap.style.visibility = "visible"; 726 | c.wrap.style.opacity = "1"; 727 | c.wrap.style.width = r.borderW + "px"; 728 | c.wrap.style.height = r.borderH + "px"; 729 | c.wrap.style.zIndex = f.zIndex; 730 | c.box.className = G; 731 | c.box.style.width = r.paddedW + "px"; 732 | c.box.style.height = r.paddedH + "px"; 733 | c.box.style.position = "relative"; 734 | c.boxB.className = H; 735 | c.boxB.style.position = "relative"; 736 | c.boxB.style.setProperty("border", f.borderWidth + "px solid " + f.borderColor, "important"); 737 | c.boxB.style.setProperty("background", f.backgroundColor, "important"); 738 | a.setBorderRadius(c.boxB, I + "px"); 739 | c.padM.style.background = "rgba(255,0,0,.2)"; 740 | c.sldM.style.background = "rgba(0,255,0,.2)"; 741 | c.asldM.style.background = "rgba(0,0,255,.2)"; 742 | c.padM.style.opacity = c.sldM.style.opacity = c.asldM.style.opacity = "0"; 743 | c.pad.style.position = "relative"; 744 | c.pad.style.width = f.width + "px"; 745 | c.pad.style.height = f.height + "px"; 746 | c.padCanvas.draw(f.width, f.height, a.getPadYChannel(f)); 747 | c.padB.style.position = "absolute"; 748 | c.padB.style.left = f.padding + "px"; 749 | c.padB.style.top = f.padding + "px"; 750 | c.padB.style.border = f.controlBorderWidth + "px solid"; 751 | c.padB.style.setProperty("border-color", f.controlBorderColor, "important"); 752 | c.padM.style.position = "absolute"; 753 | c.padM.style.left = "0px"; 754 | c.padM.style.top = "0px"; 755 | c.padM.style.width = f.padding + 2 * f.controlBorderWidth + f.width + x + "px"; 756 | c.padM.style.height = 2 * f.controlBorderWidth + 2 * f.padding + f.height + "px"; 757 | c.padM.style.cursor = "crosshair"; 758 | a.setData(c.padM, { instance: f, control: "pad" }); 759 | c.cross.style.position = "absolute"; 760 | c.cross.style.left = c.cross.style.top = "0"; 761 | c.cross.style.width = c.cross.style.height = w + "px"; 762 | c.crossBY.style.position = c.crossBX.style.position = "absolute"; 763 | c.crossBY.style.setProperty("background", f.pointerBorderColor, "important"); 764 | c.crossBX.style.setProperty("background", f.pointerBorderColor, "important"); 765 | c.crossBY.style.width = c.crossBX.style.height = 2 * f.pointerBorderWidth + f.pointerThickness + "px"; 766 | c.crossBY.style.height = c.crossBX.style.width = w + "px"; 767 | c.crossBY.style.left = c.crossBX.style.top = Math.floor(w / 2) - Math.floor(f.pointerThickness / 2) - f.pointerBorderWidth + "px"; 768 | c.crossBY.style.top = c.crossBX.style.left = "0"; 769 | c.crossLY.style.position = c.crossLX.style.position = "absolute"; 770 | c.crossLY.style.setProperty("background", f.pointerColor, "important"); 771 | c.crossLX.style.setProperty("background", f.pointerColor, "important"); 772 | c.crossLY.style.height = c.crossLX.style.width = w - 2 * f.pointerBorderWidth + "px"; 773 | c.crossLY.style.width = c.crossLX.style.height = f.pointerThickness + "px"; 774 | c.crossLY.style.left = c.crossLX.style.top = Math.floor(w / 2) - Math.floor(f.pointerThickness / 2) + "px"; 775 | c.crossLY.style.top = c.crossLX.style.left = f.pointerBorderWidth + "px"; 776 | c.sld.style.overflow = "hidden"; 777 | c.sld.style.width = f.sliderSize + "px"; 778 | c.sld.style.height = f.height + "px"; 779 | c.sldGrad.draw(f.sliderSize, f.height, "#000", "#000"); 780 | c.sldB.style.display = h ? "block" : "none"; 781 | c.sldB.style.position = "absolute"; 782 | c.sldB.style.left = f.padding + f.width + 2 * f.controlBorderWidth + 2 * x + "px"; 783 | c.sldB.style.top = f.padding + "px"; 784 | c.sldB.style.setProperty("border", f.controlBorderWidth + "px solid " + f.controlBorderColor, "important"); 785 | c.sldM.style.display = h ? "block" : "none"; 786 | c.sldM.style.position = "absolute"; 787 | c.sldM.style.left = f.padding + f.width + 2 * f.controlBorderWidth + x + "px"; 788 | c.sldM.style.top = "0px"; 789 | c.sldM.style.width = f.sliderSize + 2 * x + 2 * f.controlBorderWidth + (m ? 0 : Math.max(0, f.padding - x)) + "px"; 790 | c.sldM.style.height = 2 * f.controlBorderWidth + 2 * f.padding + f.height + "px"; 791 | c.sldM.style.cursor = "default"; 792 | a.setData(c.sldM, { instance: f, control: "sld" }); 793 | c.sldPtrIB.style.setProperty("border", f.pointerBorderWidth + "px solid " + f.pointerBorderColor, "important"); 794 | c.sldPtrOB.style.setProperty("border", f.pointerBorderWidth + "px solid " + f.pointerBorderColor, "important"); 795 | c.sldPtrOB.style.position = "absolute"; 796 | c.sldPtrOB.style.left = -(2 * f.pointerBorderWidth + f.pointerThickness) + "px"; 797 | c.sldPtrOB.style.top = "0"; 798 | c.sldPtrMB.style.setProperty("border", f.pointerThickness + "px solid " + f.pointerColor, "important"); 799 | c.sldPtrS.style.width = f.sliderSize + "px"; 800 | c.sldPtrS.style.height = a.pub.sliderInnerSpace + "px"; 801 | c.asld.style.overflow = "hidden"; 802 | c.asld.style.width = f.sliderSize + "px"; 803 | c.asld.style.height = f.height + "px"; 804 | c.asldGrad.draw(f.sliderSize, f.height, "#000"); 805 | c.asldB.style.display = m ? "block" : "none"; 806 | c.asldB.style.position = "absolute"; 807 | c.asldB.style.left = D + "px"; 808 | c.asldB.style.top = f.padding + "px"; 809 | c.asldB.style.border = f.controlBorderWidth + "px solid"; 810 | c.asldB.style.setProperty("border-color", f.controlBorderColor, "important"); 811 | c.asldM.style.display = m ? "block" : "none"; 812 | c.asldM.style.position = "absolute"; 813 | c.asldM.style.left = D + "px"; 814 | c.asldM.style.top = "0px"; 815 | c.asldM.style.width = f.sliderSize + 2 * x + 2 * f.controlBorderWidth + Math.max(0, f.padding - x) + "px"; 816 | c.asldM.style.height = 2 * f.controlBorderWidth + 2 * f.padding + f.height + "px"; 817 | c.asldM.style.cursor = "default"; 818 | a.setData(c.asldM, { instance: f, control: "asld" }); 819 | c.asldPtrIB.style.setProperty("border", f.pointerBorderWidth + "px solid " + f.pointerBorderColor, "important"); 820 | c.asldPtrOB.style.setProperty("border", f.pointerBorderWidth + "px solid " + f.pointerBorderColor, "important"); 821 | c.asldPtrOB.style.position = "absolute"; 822 | c.asldPtrOB.style.left = -(2 * f.pointerBorderWidth + f.pointerThickness) + "px"; 823 | c.asldPtrOB.style.top = "0"; 824 | c.asldPtrMB.style.setProperty("border", f.pointerThickness + "px solid " + f.pointerColor, "important"); 825 | c.asldPtrS.style.width = f.sliderSize + "px"; 826 | c.asldPtrS.style.height = a.pub.sliderInnerSpace + "px"; 827 | k(); 828 | n(); 829 | q(); 830 | a.picker.owner && a.picker.owner !== f && a.removeClass(a.picker.owner.targetElement, a.pub.activeClassName); 831 | a.picker.owner = f; 832 | f.container === p.document.documentElement ? a.redrawPosition() : a._drawPosition(f, 0, 0, "relative", !1); 833 | c.wrap.parentNode !== f.container && 834 | (h = a.node("dialog[id^='fr-dialog-']")) && 835 | (h.appendChild(c.wrap), h.hasAttribute("open") && h.close && h.close(), (h.inert = !0), h.showModal && h.showModal(), h.removeAttribute("inert"), h.focus()); 836 | a.addClass(f.targetElement, a.pub.activeClassName); 837 | } 838 | function k() { 839 | var c = a.getPadYChannel(f); 840 | c = Math.round((1 - f.channels[c] / 100) * (f.height - 1)); 841 | var h = -Math.floor((2 * f.pointerBorderWidth + f.pointerThickness + 2 * f.crossSize) / 2); 842 | a.picker.cross.style.left = Math.round((f.channels.h / 360) * (f.width - 1)) + h + "px"; 843 | a.picker.cross.style.top = c + h + "px"; 844 | switch (a.getSliderChannel(f)) { 845 | case "s": 846 | h = a.HSV_RGB(f.channels.h, 100, f.channels.v); 847 | c = a.HSV_RGB(f.channels.h, 0, f.channels.v); 848 | h = "rgb(" + Math.round(h[0]) + "," + Math.round(h[1]) + "," + Math.round(h[2]) + ")"; 849 | a.picker.sldGrad.draw(f.sliderSize, f.height, h, "rgb(" + Math.round(c[0]) + "," + Math.round(c[1]) + "," + Math.round(c[2]) + ")"); 850 | break; 851 | case "v": 852 | (c = a.HSV_RGB(f.channels.h, f.channels.s, 100)), 853 | (h = "rgb(" + Math.round(c[0]) + "," + Math.round(c[1]) + "," + Math.round(c[2]) + ")"), 854 | a.picker.sldGrad.draw(f.sliderSize, f.height, h, "#000"); 855 | } 856 | a.picker.asldGrad.draw(f.sliderSize, f.height, f.toHEXString()); 857 | } 858 | function n() { 859 | var c = a.getSliderChannel(f); 860 | c && 861 | (a.picker.sldPtrOB.style.top = 862 | Math.round((1 - f.channels[c] / 100) * (f.height - 1)) - (2 * f.pointerBorderWidth + f.pointerThickness) - Math.floor(a.pub.sliderInnerSpace / 2) + "px"); 863 | a.picker.asldGrad.draw(f.sliderSize, f.height, f.toHEXString()); 864 | } 865 | function q() { 866 | a.picker.asldPtrOB.style.top = Math.round((1 - f.channels.a) * (f.height - 1)) - (2 * f.pointerBorderWidth + f.pointerThickness) - Math.floor(a.pub.sliderInnerSpace / 2) + "px"; 867 | } 868 | function t() { 869 | return a.picker && a.picker.owner === f; 870 | } 871 | function u(c) { 872 | a.getData(c, "internal") || 873 | ((c = f.valueElement.value), 874 | f.processValueInput(f.valueElement.value), 875 | a.triggerCallback(f, "onChange"), 876 | f.valueElement.value !== c && a.triggerInputEvent(f.valueElement, "change", !0, !0)); 877 | } 878 | function v(c) { 879 | a.getData(c, "internal") || (f.valueElement && f.fromString(f.valueElement.value, a.flags.leaveValue), a.triggerCallback(f, "onInput")); 880 | } 881 | B = d; 882 | B.addEventListener("click", a.onConfigIfMouseDown, !1); 883 | var f = this; 884 | e || (e = {}); 885 | this.channels = { r: 255, g: 255, b: 255, h: 0, s: 0, v: 100, a: 1 }; 886 | this.format = "auto"; 887 | this.previewElement = this.alphaElement = this.valueElement = this.onInput = this.onChange = this.alpha = this.value = void 0; 888 | this.previewPosition = "left"; 889 | this.previewSize = 35; 890 | this.previewPadding = 8; 891 | this.forceStyle = this.uppercase = this.hash = this.required = !0; 892 | this.width = 186; 893 | this.height = 210; 894 | this.mode = "HSV"; 895 | this.alphaChannel = "auto"; 896 | this.position = "top"; 897 | this.hideOnLeave = this.showOnClick = this.smartPosition = !0; 898 | this.sliderSize = 12; 899 | this.padding = this.crossSize = 8; 900 | this.backgroundColor = "rgba(206,226,237,0.91)"; 901 | this.borderWidth = 1; 902 | this.borderColor = "rgba(187,187,187,1)"; 903 | this.borderRadius = 4; 904 | this.controlBorderWidth = 1; 905 | this.controlBorderColor = "rgba(187,187,187,0.7)"; 906 | this.pointerColor = "rgba(76,76,76,1)"; 907 | this.pointerBorderWidth = 1; 908 | this.pointerBorderColor = "rgba(255,255,255,0.6)"; 909 | this.pointerThickness = 2; 910 | this.zIndex = 2147483646; 911 | this.container = void 0; 912 | this.minS = 0; 913 | this.maxS = 100; 914 | this.minV = 0; 915 | this.maxV = 100; 916 | this.minA = 0; 917 | this.maxA = 1; 918 | this.option = function () { 919 | if (!arguments.length) throw Error("No option specified"); 920 | if (1 === arguments.length && "string" === typeof arguments[0]) 921 | try { 922 | var c = arguments[0]; 923 | if ("string" !== typeof c) throw Error("Invalid value for option name: " + c); 924 | var h = "get__" + c; 925 | if ("function" === typeof f[h]) var m = f[h](value); 926 | else if (c in f) m = f[c]; 927 | else throw Error("Unrecognized configuration option: " + c); 928 | return m; 929 | } catch (r) { 930 | return !1; 931 | } 932 | else { 933 | if (2 <= arguments.length && "string" === typeof arguments[0]) { 934 | try { 935 | if (!g(arguments[0], arguments[1])) return !1; 936 | } catch (r) { 937 | return !1; 938 | } 939 | this.redraw(); 940 | this.exposeColor(); 941 | return !0; 942 | } 943 | if (1 === arguments.length && "object" === typeof arguments[0]) { 944 | m = arguments[0]; 945 | c = !0; 946 | for (h in m) 947 | if (a.hOP.call(m, h)) 948 | try { 949 | g(h, m[h]) || (c = !1); 950 | } catch (r) { 951 | c = !1; 952 | } 953 | this.redraw(); 954 | this.exposeColor(); 955 | return c; 956 | } 957 | } 958 | throw Error("Invalid arguments"); 959 | }; 960 | this.channel = function (c, h) { 961 | if ("string" !== typeof c) throw Error("Invalid value for channel name: " + c); 962 | if ("undefined" === typeof h) return a.hOP.call(this.channels, c.toLowerCase()) ? this.channels[c.toLowerCase()] : !1; 963 | switch (c.toLowerCase()) { 964 | case "r": 965 | c = this.fromRGBA(h, null, null, null); 966 | break; 967 | case "g": 968 | c = this.fromRGBA(null, h, null, null); 969 | break; 970 | case "b": 971 | c = this.fromRGBA(null, null, h, null); 972 | break; 973 | case "h": 974 | c = this.fromHSVA(h, null, null, null); 975 | break; 976 | case "s": 977 | c = this.fromHSVA(null, h, null, null); 978 | break; 979 | case "v": 980 | c = this.fromHSVA(null, null, h, null); 981 | break; 982 | case "a": 983 | c = this.fromHSVA(null, null, null, h); 984 | break; 985 | default: 986 | return !1; 987 | } 988 | return c ? (this.redraw(), !0) : !1; 989 | }; 990 | this.trigger = function (c) { 991 | c = a.strList(c); 992 | for (var h = 0; h < c.length; h += 1) { 993 | var m = c[h].toLowerCase(), 994 | r = null; 995 | switch (m) { 996 | case "input": 997 | r = "onInput"; 998 | break; 999 | case "change": 1000 | r = "onChange"; 1001 | } 1002 | r && a.triggerCallback(this, r); 1003 | a.triggerInputEvent(this.valueElement, m, !0, !0); 1004 | } 1005 | }; 1006 | this.fromHSVA = function (c, h, m, r, w) { 1007 | "undefined" === typeof c && (c = null); 1008 | "undefined" === typeof h && (h = null); 1009 | "undefined" === typeof m && (m = null); 1010 | "undefined" === typeof r && (r = null); 1011 | if (null !== c) { 1012 | if (isNaN(c)) return !1; 1013 | this.channels.h = Math.max(0, Math.min(360, c)); 1014 | } 1015 | if (null !== h) { 1016 | if (isNaN(h)) return !1; 1017 | this.channels.s = Math.max(0, Math.min(100, this.maxS, h), this.minS); 1018 | } 1019 | if (null !== m) { 1020 | if (isNaN(m)) return !1; 1021 | this.channels.v = Math.max(0, Math.min(100, this.maxV, m), this.minV); 1022 | } 1023 | if (null !== r) { 1024 | if (isNaN(r)) return !1; 1025 | this.channels.a = this.hasAlphaChannel() ? Math.max(0, Math.min(1, this.maxA, r), this.minA) : 1; 1026 | } 1027 | c = a.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); 1028 | this.channels.r = c[0]; 1029 | this.channels.g = c[1]; 1030 | this.channels.b = c[2]; 1031 | this.exposeColor(w); 1032 | return !0; 1033 | }; 1034 | this.fromRGBA = function (c, h, m, r, w) { 1035 | "undefined" === typeof c && (c = null); 1036 | "undefined" === typeof h && (h = null); 1037 | "undefined" === typeof m && (m = null); 1038 | "undefined" === typeof r && (r = null); 1039 | if (null !== c) { 1040 | if (isNaN(c)) return !1; 1041 | c = Math.max(0, Math.min(255, c)); 1042 | } 1043 | if (null !== h) { 1044 | if (isNaN(h)) return !1; 1045 | h = Math.max(0, Math.min(255, h)); 1046 | } 1047 | if (null !== m) { 1048 | if (isNaN(m)) return !1; 1049 | m = Math.max(0, Math.min(255, m)); 1050 | } 1051 | if (null !== r) { 1052 | if (isNaN(r)) return !1; 1053 | this.channels.a = this.hasAlphaChannel() ? Math.max(0, Math.min(1, this.maxA, r), this.minA) : 1; 1054 | } 1055 | c = a.RGB_HSV(null === c ? this.channels.r : c, null === h ? this.channels.g : h, null === m ? this.channels.b : m); 1056 | null !== c[0] && (this.channels.h = Math.max(0, Math.min(360, c[0]))); 1057 | 0 !== c[2] && (this.channels.s = Math.max(0, this.minS, Math.min(100, this.maxS, c[1]))); 1058 | this.channels.v = Math.max(0, this.minV, Math.min(100, this.maxV, c[2])); 1059 | c = a.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); 1060 | this.channels.r = c[0]; 1061 | this.channels.g = c[1]; 1062 | this.channels.b = c[2]; 1063 | this.exposeColor(w); 1064 | return !0; 1065 | }; 1066 | this.fromHSV = function (c, h, m, r) { 1067 | return this.fromHSVA(c, h, m, null, r); 1068 | }; 1069 | this.fromRGB = function (c, h, m, r) { 1070 | return this.fromRGBA(c, h, m, null, r); 1071 | }; 1072 | this.fromString = function (c, h) { 1073 | if (!this.required && "" === c.trim()) return this.setPreviewElementBg(null), this.setValueElementValue(""), !0; 1074 | c = a.parseColorString(c); 1075 | if (!c) return !1; 1076 | "any" === this.format.toLowerCase() && (this._setFormat(c.format), a.isAlphaFormat(this.getFormat()) || (c.rgba[3] = 1)); 1077 | this.fromRGBA(c.rgba[0], c.rgba[1], c.rgba[2], c.rgba[3], h); 1078 | return !0; 1079 | }; 1080 | this.toString = function (c) { 1081 | "undefined" === typeof c && (c = this.getFormat()); 1082 | switch (c.toLowerCase()) { 1083 | case "hex": 1084 | return this.toHEXString(); 1085 | case "hexa": 1086 | return this.toHEXAString(); 1087 | case "rgb": 1088 | return this.toRGBString(); 1089 | case "rgba": 1090 | return this.toRGBAString(); 1091 | } 1092 | return !1; 1093 | }; 1094 | this.toHEXString = function () { 1095 | return a.hexColor(this.channels.r, this.channels.g, this.channels.b); 1096 | }; 1097 | this.toHEXAString = function () { 1098 | return a.hexaColor(this.channels.r, this.channels.g, this.channels.b, this.channels.a); 1099 | }; 1100 | this.toRGBString = function () { 1101 | return a.rgbColor(this.channels.r, this.channels.g, this.channels.b); 1102 | }; 1103 | this.toRGBAString = function () { 1104 | return a.rgbaColor(this.channels.r, this.channels.g, this.channels.b, this.channels.a); 1105 | }; 1106 | this.hide = function () { 1107 | t() && 1108 | (a.removeClass(f.targetElement, a.pub.activeClassName), a.picker.wrap && a.picker.wrap.parentNode && a.picker.wrap.parentNode.removeChild(a.picker.wrap), delete a.picker.owner); 1109 | }; 1110 | this.show = function () { 1111 | l(); 1112 | }; 1113 | this.redraw = function () { 1114 | t() && l(); 1115 | }; 1116 | this.getFormat = function () { 1117 | return this._currentFormat; 1118 | }; 1119 | this._setFormat = function (c) { 1120 | this._currentFormat = c.toLowerCase(); 1121 | }; 1122 | this.hasAlphaChannel = function () { 1123 | return "auto" === this.alphaChannel 1124 | ? "any" === this.format.toLowerCase() || a.isAlphaFormat(this.getFormat()) || "undefined" !== typeof this.alpha || "undefined" !== typeof this.alphaElement 1125 | : this.alphaChannel; 1126 | }; 1127 | this.processValueInput = function (c) { 1128 | this.fromString(c) || this.exposeColor(); 1129 | }; 1130 | this.processAlphaInput = function (c) { 1131 | this.fromHSVA(null, null, null, parseFloat(c)) || this.exposeColor(); 1132 | }; 1133 | this.exposeColor = function (c) { 1134 | var h = this.toString(), 1135 | m = this.getFormat(); 1136 | a.setDataAttr(this.targetElement, "current-color", h); 1137 | if (!(c & a.flags.leaveValue) && this.valueElement) { 1138 | if ("hex" === m || "hexa" === m) this.uppercase || (h = h.toLowerCase()), this.hash || (h = h.replace(/^#/, "")); 1139 | this.setValueElementValue(h); 1140 | } 1141 | c & a.flags.leaveAlpha || !this.alphaElement || this.setAlphaElementValue(Math.round(100 * this.channels.a) / 100); 1142 | c & a.flags.leavePreview || !this.previewElement || this.setPreviewElementBg(this.toRGBAString()); 1143 | t() && (k(), n(), q()); 1144 | }; 1145 | this.setPreviewElementBg = function (c) { 1146 | if (this.previewElement) { 1147 | var h = null, 1148 | m = null; 1149 | a.isTextInput(this.previewElement) && ((h = this.previewPosition), (m = this.previewSize)); 1150 | var r = []; 1151 | r.push({ size: "auto" }); 1152 | if (c) { 1153 | var w = a.genColorPreviewCanvas("rgba(0,0,0,0)", h ? { left: "right", right: "left" }[h] : null, m, !0); 1154 | r.push({ size: w.width + "px " + w.height + "px" }); 1155 | } 1156 | w = []; 1157 | for (var x = 0; x < r.length; x += 1) w.push(r[x].size); 1158 | c = { 1159 | "--fr-input-color": c, 1160 | "--fr-input-color-edge": m + "px", 1161 | "--fr-input-color-edge2": m + 1 + "px", 1162 | "--fr-input-gb-size": w.join(", "), 1163 | }; 1164 | a.setStyle(this.previewElement, c, !this.forceStyle); 1165 | c = { left: null, right: null }; 1166 | h && (c[h] = this.previewSize + this.previewPadding + "px"); 1167 | c = { "--fr-input-padding-left": c.left }; 1168 | a.setStyle(this.previewElement, c, !this.forceStyle, !0); 1169 | } 1170 | }; 1171 | this.setValueElementValue = function (c) { 1172 | this.valueElement && ("input" === a.nodeName(this.valueElement) ? (this.valueElement.value = c) : (this.valueElement.textContent = c)); 1173 | }; 1174 | this._processParentElementsInDOM = function () { 1175 | if (!this._parentElementsProcessed) { 1176 | this._parentElementsProcessed = !0; 1177 | var c = this.targetElement; 1178 | do { 1179 | var h = a.getCompStyle(c); 1180 | c instanceof ShadowRoot && (this.fixed = !0); 1181 | h.position && "fixed" === h.position.toLowerCase() && (this.fixed = !0); 1182 | } while ((c = c.parentNode) && "body" !== a.nodeName(c)); 1183 | } 1184 | }; 1185 | this.tryHide = function () { 1186 | this.hideOnLeave && this.hide(); 1187 | }; 1188 | if (a.pub.options) 1189 | for (var z in a.pub.options) 1190 | if (a.hOP.call(a.pub.options, z)) 1191 | try { 1192 | g(z, a.pub.options[z]); 1193 | } catch (c) { 1194 | console.error(c); 1195 | } 1196 | for (z in e) 1197 | if (a.hOP.call(e, z) && -1 === ["preset"].indexOf(z)) 1198 | try { 1199 | g(z, e[z]); 1200 | } catch (c) { 1201 | console.error(c); 1202 | } 1203 | this.container = "undefined" === typeof this.container ? p.document.documentElement : a.node(this.container); 1204 | if (!this.container) throw Error("No container element"); 1205 | this.targetElement = a.node(b); 1206 | if (!this.targetElement) throw Error("No target element"); 1207 | if (this.targetElement.frcp && this.targetElement.frcp instanceof a.pub) throw Error("Redundant Fr-Color-picker"); 1208 | this.targetElement.frcp = this; 1209 | a.addClass(this.targetElement, a.pub.className); 1210 | a.instances.push(this); 1211 | "undefined" === typeof this.valueElement 1212 | ? a.isTextInput(this.targetElement) && (this.valueElement = this.targetElement) 1213 | : null !== this.valueElement && (this.valueElement = a.node(this.valueElement)); 1214 | "undefined" === typeof this.previewElement ? (this.previewElement = this.targetElement) : null !== this.previewElement && (this.previewElement = a.node(this.previewElement)); 1215 | this.valueElement && 1216 | a.isTextInput(this.valueElement) && 1217 | ((b = this.valueElement.oninput), 1218 | (this.valueElement.oninput = null), 1219 | this.valueElement.addEventListener("change", u, !1), 1220 | this.valueElement.addEventListener("input", v, !1), 1221 | b && this.valueElement.addEventListener("input", b, !1), 1222 | this.valueElement.setAttribute("autocomplete", "off"), 1223 | this.valueElement.setAttribute("autocorrect", "off"), 1224 | this.valueElement.setAttribute("autocapitalize", "off"), 1225 | this.valueElement.setAttribute("spellcheck", !1)); 1226 | b = "FFFFFF"; 1227 | "undefined" !== typeof this.value ? (b = this.value) : this.valueElement && "undefined" !== typeof this.valueElement.value && (b = this.valueElement.value); 1228 | d = void 0; 1229 | "undefined" !== typeof this.alpha && (d = "" + this.alpha); 1230 | this._currentFormat = null; 1231 | -1 < ["auto", "any"].indexOf(this.format.toLowerCase()) ? (this._currentFormat = (e = a.parseColorString(b)) ? e.format : "hex") : (this._currentFormat = this.format.toLowerCase()); 1232 | this.processValueInput(b); 1233 | "undefined" !== typeof d && this.processAlphaInput(d); 1234 | }, 1235 | }; 1236 | a.pub.className = C; 1237 | a.pub.activeClassName = E; 1238 | a.pub.looseJSON = !0; 1239 | a.pub.sliderInnerSpace = 3; 1240 | a.pub.chessboardSize = 8; 1241 | a.pub.chessboardColor1 = "#666666"; 1242 | a.pub.chessboardColor2 = "#999999"; 1243 | a.pub.previewSeparator = []; 1244 | a.pub.init = function () { 1245 | if (!a.initialized) { 1246 | p.document.addEventListener("mousedown", a.onDocumentMouseDown, !1); 1247 | p.addEventListener("resize", a.onWindowResize, !1); 1248 | p.addEventListener("scroll", a.onWindowScroll, !1); 1249 | a.initialized = !0; 1250 | for (var b; (b = a.readyQueue.shift()); ) b(); 1251 | } 1252 | }; 1253 | a.pub.ready = function (b) { 1254 | if ("function" !== typeof b) return !1; 1255 | a.initialized ? b() : a.readyQueue.push(b); 1256 | return !0; 1257 | }; 1258 | a.pub.trigger = function (b) { 1259 | var d = function () { 1260 | a.triggerGlobal(b); 1261 | }; 1262 | a.initialized ? d() : a.pub.ready(d); 1263 | }; 1264 | a.pub.hide = function () { 1265 | a.picker && a.picker.owner && a.picker.owner.hide(); 1266 | }; 1267 | a.pub.options = {}; 1268 | a.pub.lookupClass = C; 1269 | a.pub.installByClassName = function () { 1270 | return !1; 1271 | }; 1272 | a.register(); 1273 | return a.pub; 1274 | })(); 1275 | "undefined" === typeof p.FRColorPicker && (p.FRColorPicker = A); 1276 | return A; 1277 | }); 1278 | -------------------------------------------------------------------------------- /lib/gbCookies.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name gbCookies 3 | // @description cookies tool for SearchEngine Assistant 4 | // @author F9y4ng 5 | // @version 1.6 6 | // @license GPL-3.0-only 7 | // ==/UserScript== 8 | 9 | (function (global, factory) { 10 | global = global || self; 11 | global.gbCookies = factory(); 12 | })(typeof window !== "undefined" ? window : this, function () { 13 | "use strict"; 14 | const gbCookies = { 15 | getItem: function (sKey) { 16 | return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + sKey.replace(/[-.+*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; 17 | }, 18 | setItem: function ({ sKey, sValue, sEnd, sPath, sDomain, sSameSite, sSecure }) { 19 | if (!sKey || /^(?:expires|max-age|path|domain|samesite|secure)$/i.test(sKey)) return false; 20 | let sExpires = ""; 21 | if (sEnd) { 22 | switch (sEnd.constructor) { 23 | case Number: 24 | sExpires = sEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; expires=" + new Date(Number(new Date()) + sEnd).toUTCString(); 25 | break; 26 | case String: 27 | sExpires = "; expires=" + new Date(sEnd); 28 | break; 29 | case Date: 30 | sExpires = "; expires=" + sEnd.toUTCString(); 31 | break; 32 | } 33 | } 34 | document.cookie = 35 | sKey + 36 | "=" + 37 | sValue + 38 | sExpires + 39 | (sDomain ? "; domain=" + sDomain : "") + 40 | (sPath ? "; path=" + sPath : "") + 41 | (sSameSite ? "; SameSite=" + sSameSite : "") + 42 | (sSecure ? "; secure" : ""); 43 | return true; 44 | }, 45 | removeItem: function ({ sKey, sPath, sDomain }) { 46 | if (!sKey || !this.hasItem(sKey)) return false; 47 | document.cookie = sKey + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : ""); 48 | return true; 49 | }, 50 | hasItem: function (sKey) { 51 | return new RegExp("(?:^|;\\s*)" + sKey.replace(/[-.+*]/g, "\\$&") + "\\s*\\=").test(document.cookie); 52 | }, 53 | }; 54 | return gbCookies; 55 | }); 56 | --------------------------------------------------------------------------------