 |
 |
 |
Userscript index, For non-HV scripts |
|
Oct 26 2020, 06:41
|
blue penguin
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12

|
Finally cleaned up the OP. Thanks for the scripts folks.
|
|
|
|
 |
|
Nov 13 2020, 01:54
|
Moonlight Rambler
Group: Gold Star Club
Posts: 6,403
Joined: 22-August 12

|
Adds "speed dial" buttons for commonly-used queries to the advanced search options panel, which it also makes always visible. Good for searches you do a lot. I really, really need to refactor this, but believe me it used to look worse and be three times as repetitive and long. If there's anything nonsensical in here, I'm probably going to blame that on the original script this is derived from as well. Also, I think I completely ignored the fact that I can actually use ${varname} within template literals (the backticked, multi-line strings). I'd install it from [ gitlab.com] my gitlab repo, since the forum software has bungled my scripts before, but here it is inline, too. CODE // ==UserScript== // @name EHG Usual Tags Button // @namespace dragontamer8740.ehgUsualTagsButton // @description Add button(s) for "speed dial" fast search terms to EHG. Makes advanced search pane always be visible, too. // @include http://g.e-hentai.org/* // @include http://e-hentai.org/* // @include http://e-hentai.org/* // @include https://g.e-hentai.org/* // @include https://e-hentai.org/* // @include https://e-hentai.org/* // @match http://g.e-hentai.org/* // @match http://e-hentai.org/* // @match http://e-hentai.org/* // @match https://g.e-hentai.org/* // @match https://e-hentai.org/* // @match https://e-hentai.org/* // @version 1 // @grant none // ==/UserScript==
if(document.querySelector('input[name="f_search"]')) // only if search bar exists on current page { if(!document.getElementById("showAdvSearchLink")) { document.querySelector('a[onclick="toggle_advsearch_pane(this); return false"]').setAttribute("id", "showAdvSearchLink"); } if(document.getElementById("advdiv").style.display == "none") { //was originally an 'onClick' passing 'this' as the link to change the text on //toggle_advsearch_pane(document.querySelector('a[onclick="toggle_advsearch_pane(this); return false"')); toggle_advsearch_pane(document.getElementById("showAdvSearchLink")); }
function addCustomButton(buttonLabel, tagValue, tagFuncName, afterElement) { var advSearchElements=document.querySelectorAll(".itss")[0].children[0]; var additionalButtonScript=document.createElement("script"); // we're making an inline script and injecting it into the page sources so buttons can use the functions. One per button, for now. // I think I could and should rewrite this so one function that takes parameters of tag name, etc. is passed instead. // add a script to the dom so I can call it with a button additionalButtonScript.innerHTML='function ' + tagFuncName + `() { if (document.querySelector('input[name="f_search"]').value == '') { document.querySelector('input[name="f_search"]').value += '` + tagValue + `'; } //if it's already in the search field (case insensitive), don't do anything. Otherwise, add it to the end. else if (!(document.querySelector('input[name="f_search"]').value.toUpperCase().includes('` + tagValue + `'.toUpperCase()))) { document.querySelector('input[name="f_search"]').value += ' ` + tagValue + `'; } document.querySelector('input[name="f_search"]').focus(); }`; document.body.appendChild(additionalButtonScript); var newButton=document.createElement('input'); newButton.setAttribute('type','button'); newButton.setAttribute('value',buttonLabel); newButton.setAttribute('onclick', tagFuncName + '();'); afterElement.appendChild(newButton); if(afterElement.firstChild) // has at least one child already (not sure I need this anymore since refactoring, might even be nonsensical) { advSearchElements.children[advSearchElements.children.length-2].insertBefore(afterElement,null); } }
var newTd=document.createElement("td"); // table cell for buttons to go into, gets inserted inside the function call
// add all of the buttons you want here; just make sure they all use different function names (second-to-last argument). // syntax (Note that insertion point can always be 'newtd,' I think): // 'Button label', 'Tag to insert', 'Unique Function Name', 'Insertion point' addCustomButton('English', 'l:english', 'tagAddEnglish', newTd); } Edit: fixed typo (too many "T"'s in addCustomButton's old name) This post has been edited by dragontamer8740: Nov 14 2020, 20:39
|
|
|
|
 |
|
Aug 8 2021, 16:58
|
Moonlight Rambler
Group: Gold Star Club
Posts: 6,403
Joined: 22-August 12

|
Made a user script that makes the "show tag definitions" and "show tagged galleries" buttons both open in a new tab, instead of a popup window (for "show tag definition") or navigating away from the current page (for "show tagged galleries"). You might have to change 'dom.popup_maximum' to 0 in firefox, but I don't think you will (since I think javascript is allowed to open new tabs on clicks normally). CODE // ==UserScript== // @name EH Show Tag Definitions and Tagged Galleries in New Tabs // @namespace dragontamer8740.ehgTagInfo // @description Show tag definitions and tagged galleries in a new tab instead of in a popup/in the current window. // @include http://e-hentai.org/g/* // @include https://e-hentai.org/g/* // @version 1 // @grant none // ==/UserScript==
// make a new <script> block in HTML to append to end of body to override the original functions. var definitionScript = document.createElement("script"); /* I got the original script definitions using function_name.toSource() and * then edited them. * Inserting back into the page without using * unsafeWindow. (doesn't matter for GM 4 in this case I guess). The original * used '\s' like so, but it doesn't appear to work quite like I expected * it to. Tenboro's regex was: * selected_tag.replace(/[a-z]+:\s?/gi,\"\") */
// tag_define() in new window/tab instead of popup definitionScript.innerHTML="function tag_define(){window.open(\"https://ehwiki.org/wiki/\"+selected_tag.replace(/[a-z]+:/gi,\"\"))}" + "\n"; //tag_show_galleries() in new window/tab instead of current window/tab definitionScript.innerHTML+="function tag_show_galleries(){window.open(base_url+\"tag/\"+selected_tag.replace(/ /g,\"+\"))}"; // supersede the original definitions of tag_define() and tag_show_galleries() document.body.appendChild(definitionScript); // no longer needed as a variable, since it's now present in the page itself: definitionScript.remove(); This post has been edited by dragontamer8740: Aug 8 2021, 16:59
|
|
|
|
 |
|
Aug 26 2021, 01:28
|
Moonlight Rambler
Group: Gold Star Club
Posts: 6,403
Joined: 22-August 12

|
Updated my image resizing/fitting script a bit, now it's totally Greasemonkey 4-compatible. Previously I wasn't able to get it to remember view settings between pages in GM4… I was overthinking some asynchronous functions. [ gitlab.com] https://gitlab.com/dragontamer8740/dragonta...-tweaks.user.jsThere's a writeup I did describing how to use it here. I've also pushed changes to most of my other scripts in the last few months, too, but those were mostly just adding more site support and such. I think making a script actually work for people that didn't fully work before warrants mentioning though. This post has been edited by dragontamer8740: Aug 26 2021, 01:32
|
|
|
|
 |
|
Oct 24 2021, 06:10
|
Xㅤㅤ
Newcomer
 Group: Members
Posts: 24
Joined: 18-February 19

|
EhEnhancePageTurning: This is a userscript that allows you to click on the left half of an image to turn to previous page and click on the right half of an image to turn to next page in the gallery view. The arrow direction of your cursor will be changed when cursor location changes. CODE // ==UserScript== // @name EhEnhancePageTurning // @version 0.1 // @description EnhancePageTurning // @author X-4605265 // @icon https://greasyfork.org/packs/media/images/blacklogo16-5421a97c75656cecbe2befcec0778a96.png // @icon64 https://greasyfork.org/packs/media/images/blacklogo96-b2384000fca45aa17e45eb417cbcbb59.png // @run-at document-end // @match *://e-hentai.org/s/* // @match *://e-hentai.org/s/* // @grant none // ==/UserScript==
(() => { "use strict";
const galleryUrl = document.querySelector("div.sb > a").href, h1 = document.querySelector("h1"); h1.outerHTML = `<a href="${galleryUrl}" target="_blank" style="text-decoration:none;">${h1.outerHTML}</a>`; let img = document.getElementById("img"), a = img.parentNode, i3 = document.getElementById("i3"); i3.style.cssText = "text-align: center; position: relative;"; i3.append(img); a.removeAttribute("href"); let ap = a.cloneNode(), apCss = "width: 50%; height: 80%; position: absolute; left: 0; top: 10%; z-index: 12; cursor: url(//ehgt.org/g/p.png),auto;", aCss = "width: 50%; height: 80%; position: absolute; right: 0; top: 10%; z-index: 12; cursor: url(//ehgt.org/g/n.png),auto;"; ap.onclick = document.querySelector("a#prev").onclick; a.style.cssText = aCss; ap.style.cssText = apCss; i3.prepend(ap); let hookedFn = apply_json_state; apply_json_state = function (a) { let apOnClikck = a.n.match(/prev.*?(return.*?)"/)[1]; a.i3 = a.i3 .replace(/href.*?"/, "") .replace( /(^.*?onclick.*?\)")(.*?>)(<img.*?\/>)(.*?$)/, `<a onclick="${apOnClikck}" style="${apCss}">$4$1 style="${aCss}"$2$4$3` ); hookedFn(a); }; })(); This post has been edited by Xㅤㅤ: Oct 25 2021, 04:13
|
|
|
|
 |
|
Nov 6 2021, 15:04
|
JohnyXD
Newcomer
  Group: Members
Posts: 72
Joined: 19-August 11

|
gallery-rating: Basic script that replaces the star ratings with numeral values. EDIT : Managed to fix a bug when using Compact layout and get user rating with a little brut force :/ Still a little bare-bones.
gallery_rating.user.js.txt ( 4.75k )
Number of downloads: 149This post has been edited by JohnyXD: Nov 11 2021, 22:16
|
|
|
|
 |
|
Nov 7 2021, 15:17
|
uareader
Group: Catgirl Camarilla
Posts: 5,592
Joined: 1-September 14

|
QUOTE(fyxie @ Dec 19 2016, 09:56)  CSS mod for the multi-page viewer to make all images fit your browser. Anyone would know if there's a way (probably with javascript, with an userscript) to make the thumbnails in the left show when hovering the left side, displaying above the rest of the page (thus not destroying the page order and all), and hiding when going out of the now shown thumbnail area? This is the general idea, another mean to toggle on/off the thumbnails without losing the current page could work too. I supposed it was better to ask here than in Userscript index, For non-HV scripts since it was a request on something already existing. If I supposed wrong, tell me so I can repost this in the right place.
|
|
|
|
 |
|
Nov 26 2021, 03:42
|
kiwino
Group: Members
Posts: 341
Joined: 21-November 16

|
E-Hentai Automated Downloads - by hzqr (formerly tiap) Dont we have this feature already? looks like useless putting it in index
|
|
|
Nov 26 2021, 10:21
|
Mayriad
Group: Global Mods
Posts: 2,061
Joined: 18-December 10

|
QUOTE(kiwino @ Nov 26 2021, 01:42)  E-Hentai Automated Downloads - by hzqr (formerly tiap) Dont we have this feature already? looks like useless putting it in index
We don't. That script is unique enough to be added here.
|
|
|
|
 |
|
Dec 24 2021, 04:31
|
Hentai-Lurker
Newcomer
 Group: Recruits
Posts: 12
Joined: 18-June 12

|
Script request: I'd like a visual indication which thumbnail in a gallery corresponds to a GIF image. Suggestion: The DOM part for each thumbnail looks like this (for large thumbnails; replace "gdtl" with "gdtm" for the smaller ones): CODE <div class="gdtl" style="height:320px"> <a href="https://e-hentai.org/s/6fe4bf3c9d/1972264-6"> <img alt="0006" title="Page 6: 1a37da3308b9e515b1792cbdfd63b7d535630970.png" src="https://ehgt.org/6f/e4/6fe4bf3c9dbe05e02e2851f58b916233cff9432c-725773-1273-1400-png_l.jpg"> </a> </div> Changing the background-color of the <div> if the title of the <img> 2 levels below it ends in ".gif" should do the trick. Thank you!
|
|
|
|
 |
|
Dec 24 2021, 04:34
|
Shank
Group: Global Mods
Posts: 9,039
Joined: 19-May 12

|
I didn't do it in the method you wanted, so this may not be what you want, but I replied to your helpdesk thread on this with a potential solution QUOTE(Shank @ Dec 24 2021, 02:13)  This is something I made a while back CODE // ==UserScript== // @name Gif Highlighter // @include https://e-hentai.org/g/* // @version 1.0.0 // @author Shank // @grant GM_addStyle // @run-at document-start // ==/UserScript== GM_addStyle ( ` img[title$="gif"] {border: 5px solid red!important;} img[title$="png"] {border: 5px solid green!important;} ` ); Adds a red border to gif thumbnails, a green border to png, everything else (jpg) as no border. Can just delete the png line if undesired, and its just css so you can modify the style how you want. Someone will probably be able to do it far better than me. It doesn't guarantee that the files are animated, only that they are gif. (IMG:[ files.catbox.moe] https://files.catbox.moe/ls2nms.PNG) This obviously is hard to spot if the gif already has red borders, such as having a red background, I don't know what the browser support is like, but you can instead do something like: CODE // ==UserScript== // @name Gif Highlighter // @include https://e-hentai.org/g/* // @version 1.0.0 // @author Shank // @grant GM_addStyle // @run-at document-start // ==/UserScript== GM_addStyle ( ` img[title$="gif"] {box-shadow: 0px 0px 0px 5px rgba(255,0,0,0.9);} img[title$="png"] {box-shadow: 0px 0px 0px 5px rgba(0,255,0,0.9);} ` ); Which will keep the black border default with e-h, and uses drop shadow that looks like a border instead (IMG:[ files.catbox.moe] https://files.catbox.moe/5p5d86.PNG) Worth noting, you can also just throw the css part onto something like stylus and it'll work just as well
|
|
|
|
 |
|
Dec 24 2021, 08:34
|
Hentai-Lurker
Newcomer
 Group: Recruits
Posts: 12
Joined: 18-June 12

|
QUOTE(Shank @ Dec 23 2021, 21:34)  I didn't do it in the method you wanted, so this may not be what you want, but I replied to your helpdesk thread on this with a potential solution Worth noting, you can also just throw the css part onto something like stylus and it'll work just as well
Thank you, this is much better than what I suggested, precisely for that reason.
|
|
|
Dec 31 2021, 12:55
|
GO_KENTA
Newcomer
  Group: Members
Posts: 60
Joined: 18-November 13

|
QUOTE(blue penguin @ Nov 28 2016, 21:31)  The NoStylish pack doesn't seem to work for me with Violentmonkey on Firefox, can anyone confirm if they work on their end? Also, are there any other valid visual styles that you recommend?
|
|
|
Dec 31 2021, 13:27
|
Shank
Group: Global Mods
Posts: 9,039
Joined: 19-May 12

|
It fails here. Not that I'm particularly surprised, been some changes since 2017
|
|
|
Dec 31 2021, 13:42
|
GO_KENTA
Newcomer
  Group: Members
Posts: 60
Joined: 18-November 13

|
That's unfortunate. I'm looking for a darker theme than the default one because I have bad eyes but I can't seem to make any of the ones that I've found work. Guess I'll give up.
|
|
|
Dec 31 2021, 13:47
|
Shank
Group: Global Mods
Posts: 9,039
Joined: 19-May 12

|
|
|
|
Dec 31 2021, 14:06
|
GO_KENTA
Newcomer
  Group: Members
Posts: 60
Joined: 18-November 13

|
Yeah I know, tried that as well and it still displays the default light theme despite setting it to dark in the settings. I guess it's a Violentmonkey limit or something.
EDIT: Tried another userscript manager and it was indeed Violentmonkey's fault...
This post has been edited by GO_KENTA: Dec 31 2021, 14:20
|
|
|
Feb 21 2022, 23:42
|
hzqr
Group: Gold Star Club
Posts: 4,672
Joined: 13-May 09

|
Small script to force MPV to scale images to fit the screen when in fullscreen mode and improve the navigation: [ pastebin.com] https://pastebin.com/raw/rX2SKn7KNo idea if something similar already exists (it probably does) Usage: - Open image in MPV
- Hit F11 to go fullscreen
- Use PageUp/PageDown to navigate
|
|
|
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:
|
 |
 |
 |
|