├── AutoRetry.js ├── CopyLinkText.js ├── GoogleTranslate.js ├── GoogleTranslateElement.js ├── LICENSE ├── PrivoxyURLInfo.js ├── README.md ├── ReloadImages.js └── ToggleDesignMode.js /AutoRetry.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name AutoRetry 3 | // @match http*://* 4 | // @run-at document-end 5 | // ==/UserScript== 6 | 7 | window.ec && setTimeout(() => retry(), 10000); 8 | -------------------------------------------------------------------------------- /CopyLinkText.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Copy Link Text 3 | // @match * 4 | // @run-at context-menu 5 | // ==/UserScript== 6 | 7 | if (document.activeElement.tagName === 'A'){ 8 | let text = document.activeElement.text.trim(); 9 | 10 | text && navigator.clipboard.writeText(text); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /GoogleTranslate.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Google Translate 3 | // @match http*://* 4 | // @run-at context-menu 5 | // ==/UserScript== 6 | 7 | var selection = getSelection().toString(); 8 | var gt = `https://translate.google.com/%s${navigator.language.match(/^(zh-)?\w+/g)}`; 9 | 10 | if (selection) 11 | window.open(`${gt.replace('%s', '#auto/')}/${selection}`, '_blank'); 12 | else 13 | window.open(`${gt.replace('%s', 'translate?sl=auto&tl=')}&u=${location.href}`, '_blank'); 14 | -------------------------------------------------------------------------------- /GoogleTranslateElement.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Google Translate Element 3 | // @match http*://* 4 | // @run-at document-end 5 | // ==/UserScript== 6 | 7 | const gtel_id = 'google_translate_element'; 8 | 9 | if (!document.getElementById(gtel_id)) { 10 | googleTranslateElementInit = () => { 11 | new google.translate.TranslateElement({ 12 | pageLanguage: 'auto', 13 | layout: google.translate.TranslateElement.InlineLayout.SIMPLE 14 | }, gtel_id); 15 | } 16 | 17 | const google_translate_element = document.createElement('div'); 18 | google_translate_element.id = gtel_id; 19 | google_translate_element.setAttribute('style', 'position: fixed; bottom: 0; right: 0; z-index: 99999; cursor: move; width: max-content; height: max-content; padding-left: 0.5em; background: linear-gradient(45deg,#fff,#fff 50%,#000 50%,#000); background-size: 2px 2px;'); 20 | google_translate_element.draggable = true; 21 | google_translate_element.ondrag = google_translate_element.ondragend = e => { 22 | e.preventDefault(); 23 | e.stopPropagation(); 24 | google_translate_element.style.top = `${e.y + (e.type === 'drag' ? google_translate_element.offsetTop : 0)}px`; 25 | google_translate_element.style.left = `${e.x + (e.type === 'drag' ? google_translate_element.offsetLeft : 0)}px`; 26 | }; 27 | 28 | document.body.appendChild(google_translate_element); 29 | 30 | const script = document.createElement('script'); 31 | script.src = 'https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'; 32 | document.getElementById(gtel_id).appendChild(script); 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Sergiy Stupar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /PrivoxyURLInfo.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Privoxy URL Info 3 | // @match http*://* 4 | // @run-at context-menu 5 | // ==/UserScript== 6 | 7 | window.open(`http://config.privoxy.org/show-url-info?url=${location.href}`, '_blank'); 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Min Userscripts 2 | 3 | A collection of userscripts for [Min](https://minbrowser.org) browser. 4 | 5 | ## Auto Retry 6 | 7 | Automatically retries to load a page until it is available with 10 seconds interval. 8 | 9 | ## Copy Link Text 10 | 11 | Copy the text of the link. 12 | 13 | ## Google Translate 14 | 15 | Translate selected text or page if no selection to browser language. 16 | 17 | ## Google Translate Element 18 | 19 | Automatically inserts Google Translate Element into the page. 20 | 21 | ## Reload Images 22 | 23 | Reload all images on the page. 24 | 25 | ## Privoxy URL Info 26 | 27 | Look up which actions apply to a URL of the current page and why. 28 | 29 | ## Toggle Design Mode 30 | 31 | Edit any page. 32 | 33 | ## Installation 34 | 35 | * Enable userscripts in Min and create a `userscripts` folder following [these instructions](https://github.com/minbrowser/min/wiki/userscripts), and copy script inside it. 36 | * Restart Min. 37 | -------------------------------------------------------------------------------- /ReloadImages.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Reload Images 3 | // @match http*://* 4 | // @run-at context-menu 5 | // ==/UserScript== 6 | 7 | for (let image of document.images) image.src = image.src; 8 | -------------------------------------------------------------------------------- /ToggleDesignMode.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Toggle Design Mode 3 | // @match * 4 | // @run-at context-menu 5 | // ==/UserScript== 6 | 7 | document.designMode = document.designMode === 'off' ? 'on' : 'off'; 8 | 9 | --------------------------------------------------------------------------------