biodude711 said:
I tried installing the script on my PC and it is not working.
Resolved over DM. Script won't work with Greasemonkey. Use something less outdated (Violentmonkey, Tampermonkey).
Posted under General
https://update.greasyfork.org/scripts/484162/Danbooru%20tags%20buttons.user.js
Here is my own script for "+" "-" buttons which doesn't use anything besides old plain Javascript and it should work everywhere
Updated
The Miscellaneous Tweaks script's option for adding +/- links is now fixed as well.
Make the search bar whole-page wide and pinned to the top of the page.
If used with BrokenEagle98's PostModeMenu+, also makes the post mode menu wide and pinned as well.
https://github.com/hdk5/danbooru.user.js/blob/master/dist/sticky-search.user.js?raw=1
岩戸鈴芽 said:
I was actually unaware of this redirect, here's a bookmarklet you can use to easily copy the stacc URL, similar to the one for Twitter intent IDs. Same disclaimer about using Pixiv in anything other than English applies:
javascript:(() => fetch(location.href.replace("en/users", "stacc/id")).then(r => prompt("stacc URL", r.url)))()
Thanks, I only noticed it now, but that is very helpful!
I had to modify it a bit, since I don't use pixiv in English, and my browser evaluates javascript:
URIs differently
Thus, it is better to just first remove "en/" if it is there, and wrap the function in void
javascript:void(()=>fetch(location.href.replace("en/","").replace("users","stacc/id")).then(r=>prompt("stacc URL",r.url)))()
I also ended up making a few for other sites by example:
Misskey: javascript:void(()=>prompt("misskey URL",document.querySelector("link[rel=alternate]").href))() Bluesky: javascript:void(()=>prompt("bsky URL",`https://bsky.app/profile/${document.querySelector("meta[name='twitter:value1']").content}`))() Inkbunny: javascript:void(()=>prompt("inkbunny URL",`https://inkbunny.net/user.php?user_id=${new URL(document.querySelector('#watches .title_stealthy_link').href).searchParams.get('user_id')}`))() FANBOX: javascript:void(()=>(window.wrappedJSObject||window).eval("fetch(`https://api.fanbox.cc/creator.get?creatorId=${location.host==='www.fanbox.cc'?location.pathname.match(/[\\w-]+/)[0]:location.host.match(/[\\w-]+/)[0]}`).then(r=>r.json()).then(j=>prompt('fanbox URL',`https://www.pixiv.net/fanbox/creator/${j.body.user.userId}`))"))()
Unsure whether someone else also made something similar, but until the site supports it this bookmarklet obtains the original(-ish) file from a Bluesky post as described in issue #5640, instead of the potentially upscaled image.
Note that tools like gallery-dl
, at least for now, obtain the latter, wrong file, for example post #7192377:
gallery-dl
: 1243x2000 https://danbooru.donmai.us/media_assets/18772054javascript:void(()=>{ document.querySelectorAll("meta[property='og:image']").forEach(e => { const url = new URL("https://bsky.social/xrpc/com.atproto.sync.getBlob"); const match = e.content.match(/.+(did:.+)\/(.+)@(.+)/); url.searchParams.append("did", match[1]); url.searchParams.append("cid", match[2]); fetch(url).then(r => r.blob()).then(blob => { const ourl = window.URL.createObjectURL(blob); const a = document.createElement("a"); a.href = ourl; a.download = `${match[2]}.${match[3]}`; a.target = "_blank"; document.body.appendChild(a); a.click(); document.body.removeChild(a); window.URL.revokeObjectURL(ourl); }); }); })()
Not extensively tested so it may break, please let me know if it does.
Edit 1: Now works with multiple images in a post.
Edit 2: Danbooru now fetches the correct image.
Updated
hdk5 said:
I also ended up making a few for other sites by example:
Seems the bsky one got broken overnight, here's the new one:
javascript:void(()=>fetch(`https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=${location.href.match(/profile\/([^/]+)/)[1]}`).then(r=>r.json()).then(j=>prompt("bsky URL",`https://bsky.app/profile/${j.did}`)))()
hdk5 said:
Seems the bsky one got broken overnight, here's the new one:
javascript:void(()=>fetch(`https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=${location.href.match(/profile\/([^/]+)/)[1]}`).then(r=>r.json()).then(j=>prompt("bsky URL",`https://bsky.app/profile/${j.did}`)))()
This still works without API call
javascript:void(()=>prompt("bsky URL",`https://bsky.app/profile/${document.querySelector('meta[content^="did:"]').content}`))()
Remade my old Tag Preview userscript for it to be less ugly.
Now it will show all tags with aliases and implications, as well as deprecations and some auto-tags in a more compact tree manner, similar to the way character/copyright implications are shown on posts, with a checkbox for a quicker implication trees removal.
https://github.com/hdk5/danbooru.user.js/blob/master/dist/tag-preview.user.js?raw=1
At the first time, this was just a bug fix for Android System Webview-based browsers that couldn't display a tooltip with a long press like Firefox for Android or Chrome for Android.
Now you can simply tap to show scorer list tooltip or favoritor list tooltip and tap again to navigate to list page.
// ==UserScript== // @name Tap to show tooltip // @version 0.2 // @description Tap to show scorer list tooltip or favoritor list tooltip on touch device // @author Sibyl // @run-at document-end // @match *://danbooru.donmai.us/* // @grant none // ==/UserScript== (function() { "use strict"; document.addEventListener('click', event => { const a = event.target; if (event.target.tagName === "A" && (a.parentElement.classList.contains('post-score') || a.parentElement.classList.contains('post-favcount'))) { if (!a.focused) { event.preventDefault(); a.focused = true; a.addEventListener("blur", () => { a.focused = false; }); } } }); })();
Updated
hdk5 said:
Add back recently removed "+ -" links next to tags in tag lists.
https://github.com/hdk5/danbooru.user.js/blob/master/dist/plus-minus.user.js?raw=1
amazing, thanks
Some users like me who don't like to add posts to their favorites may add them to their favorite groups.
This simple userscript can show how many public favorite groups the current post has been added to.
// ==UserScript== // @name Show fav groups count // @version 0.1 // @description Show fav groups count in post infomation column // @author Sibyl // @match *://*.donmai.us/posts/* // @grant none // ==/UserScript== (() => { const HIDE_IF_NO_FAVGROUPS_YET = false; const postId = document.body.dataset["postId"]; if (!postId) return; fetch( "/favorite_groups.json?only=id&limit=100&search%5Bpost_ids_include_all%5D=" + postId ) .then(resp => resp.json()) .then(json => { if (Array.isArray(json)) { let len = json.length; if (len === 0 && HIDE_IF_NO_FAVGROUPS_YET) return; len = len > 100 ? len + "+" : len; document .getElementById("post-info-favorites") ?.insertAdjacentHTML( "afterend", `<li id="post-info-favgroups">Favgroups: <a href="/favorite_groups?search%5Bpost_ids_include_all%5D=${postId}" target="_blank">${len}</a></li>` ); } }); })();
A userscript @Sibyl made that shows ratings under post thumbnails next to score. Makes it easier to spot misrated posts without opening the post or loading the post tooltip.
// ==UserScript== // @name Show rating under thumbnail // @namespace http://tampermonkey.net/ // @version 0.1 // @match https://*.donmai.us/* // @grant none // ==/UserScript== (function () { "use strict"; document.querySelectorAll(".post-preview").forEach(e => { e.querySelector(".post-votes").insertAdjacentHTML( "beforeend", `<span style="color:var(--muted-text-color);" class="text-center whitespace-nowrap align-middle min-w-4">${e .getAttribute("data-rating") .toUpperCase()}</span>` ); }); })();