Userscripts by Nobody
How to use:
Create a bookmark, but where you would normally put a URL, instead put the "formatting-stripped bookmarklet URL" from one of the bookmarklets below. Then, while on any page of any chapter on Dynasty, click the bookmark. Instead of navigating to a page, your browser will run the code you copied into the URL field.
If you have any questions or comments, feel free to reach out to me on the Dynasty Discord server.
Dynasty Scans Preload + Long Strip (Bookmarklet)
Last updated: August 12th, 2023
About:
This bookmarklet replaces the single page shown in the reader with a vertical scroll of every page in the chapter. It can be used to preload a chapter's pages, stitch together long strips, or just read any chapter in a vertical-scroll format. Two slightly different versions and their respective advantages are listed below.
Sequential version:
This version waits for each page to finish loading before it begins loading the next one. It takes more time to reach a fully-loaded chapter, but ensures that if you start reading while the chapter is still loading, you won't accidentally skip not-yet-loaded pages.
Nicely formatted code: Hosted on Pastebin
Formatting-stripped bookmarklet URL:
javascript:(async()=>{let%20imageDiv=document.querySelector("#image");let%20linksDiv=imageDiv.appendChild(document.createElement("div"));linksDiv.appendChild(document.querySelector("#image>.pages-list>#prev_link"));linksDiv.appendChild(document.createTextNode("\xa0".repeat(40)));linksDiv.appendChild(document.querySelector("#image>.pages-list>#next_link"));let%20pagesDiv=imageDiv.appendChild(document.createElement("div"));let%20numLoaded=0;let%20numLoadedDiv=imageDiv.appendChild(document.createElement("div"));numLoadedDiv.textContent=`Loaded%200/${pages.length}`;let%20topButton=imageDiv.appendChild(document.createElement("div")).appendChild(document.createElement("button"));topButton.textContent="Scroll%20to%20Top";topButton.onclick=()=>{window.scrollTo({top:0,behavior:"smooth"});};for(const%20node%20of%20document.querySelectorAll("#image>.pages-list,#image>.left,#image>.right,#image>img")){node.parentNode.removeChild(node);}for(const%20page%20of%20pages){let%20newImg=document.createElement("img");let%20imgDone=new%20Promise((resolve)=>{newImg.onload=newImg.onerror=resolve;});newImg.alt=page.name;newImg.src=page.image;pagesDiv.appendChild(document.createElement("div")).appendChild(newImg);await%20imgDone;numLoadedDiv.textContent=`Loaded%20${++numLoaded}/${pages.length}`;}})()
Parallel version:
This version immediately begins loading every page. It takes less time to reach a fully-loaded chapter, but if you start reading while the chapter is still loading, you may accidentally skip not-yet-loaded pages.
Nicely formatted code: Hosted on Pastebin
Formatting-stripped bookmarklet URL:
javascript:(()=>{let%20imageDiv=document.querySelector("#image");let%20linksDiv=imageDiv.appendChild(document.createElement("div"));linksDiv.appendChild(document.querySelector("#image>.pages-list>#prev_link"));linksDiv.appendChild(document.createTextNode("\xa0".repeat(40)));linksDiv.appendChild(document.querySelector("#image>.pages-list>#next_link"));let%20numLoaded=0;let%20numLoadedDiv=imageDiv.appendChild(document.createElement("div"));numLoadedDiv.textContent=`Loaded%200/${pages.length}`;let%20pagesDiv=imageDiv.appendChild(document.createElement("div"));let%20topButton=imageDiv.appendChild(document.createElement("div")).appendChild(document.createElement("button"));topButton.textContent="Scroll%20to%20Top";topButton.onclick=()=>{window.scrollTo({top:0,behavior:"smooth"});};for(const%20node%20of%20document.querySelectorAll("#image>.pages-list,#image>.left,#image>.right,#image>img")){node.parentNode.removeChild(node);}for(const%20page%20of%20pages){let%20newImg=document.createElement("img");newImg.onload=newImg.onerror=()=>{numLoadedDiv.textContent=`Loaded%20${++numLoaded}/${pages.length}`;};newImg.alt=page.name;newImg.src=page.image;pagesDiv.appendChild(document.createElement("div")).appendChild(newImg);}})()
Dynasty Scans Preload (Bookmarklet)
Last updated: January 27th, 2024
About:
This bookmarklet preloads a chapter's pages without changing the format of the reader. Pages are preloaded as a near-transparent row of one-pixel images so that they're technically visible (to minimize the chances of your browser unloading them) while still being essentially invisible. Two slightly different versions and their respective advantages are listed below.
Sequential version:
This version waits for each page to finish preloading before it begins preloading the next one. It takes more time to reach a fully-preloaded chapter, but if you start reading while the chapter is still preloading, you're less likely to encounter not-yet-preloaded pages.
Nicely formatted code: Hosted on Pastebin
Formatting-stripped bookmarklet URL:
javascript:(async()=>{let%20pagesDiv=document.createElement("div");pagesDiv.style.lineHeight="1px";pagesDiv.style.opacity="0.01";document.querySelector("#image").prepend(pagesDiv);for(const%20page%20of%20pages){let%20newImg=document.createElement("img");let%20imgDone=new%20Promise((resolve)=>{newImg.onload=newImg.onerror=resolve;});newImg.style.width=newImg.style.height="1px";newImg.style.verticalAlign="bottom";newImg.src=page.image;pagesDiv.appendChild(newImg);await%20imgDone;}})()
Parallel version:
This version immediately begins preloading every page. It takes less time to reach a fully-preloaded chapter, but if you start reading while the chapter is still preloading, you're more likely to encounter not-yet-preloaded pages.
Nicely formatted code: Hosted on Pastebin
Formatting-stripped bookmarklet URL:
javascript:(()=>{let%20pagesDiv=document.createElement("div");pagesDiv.style.lineHeight="1px";pagesDiv.style.opacity="0.01";document.querySelector("#image").prepend(pagesDiv);for(const%20page%20of%20pages){let%20newImg=document.createElement("img");newImg.style.width=newImg.style.height="1px";newImg.style.verticalAlign="bottom";newImg.src=page.image;pagesDiv.appendChild(newImg);}})()
last edited at Mar 19, 2024 9:33PM by NobodyNobody