SH Continue Reading Anywhere

When viewing any chapter on Scribble Hub, this will add a button to continue reading from your current bookmarked chapter.

安装此脚本?
作者推荐脚本

您可能也喜欢SH Auto Show Bookmark

安装此脚本
  1. // ==UserScript==
  2. // @name SH Continue Reading Anywhere
  3. // @namespace ultrabenosaurus.ScribbleHub
  4. // @version 0.3
  5. // @description When viewing any chapter on Scribble Hub, this will add a button to continue reading from your current bookmarked chapter.
  6. // @author Ultrabenosaurus
  7. // @license GNU AGPLv3
  8. // @source https://greasyfork.org/en/users/437117-ultrabenosaurus?sort=name
  9. // @match https://www.scribblehub.com/read/*/chapter/*
  10. // @icon https://www.google.com/s2/favicons?domain=scribblehub.com
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. var ficID = window.location.pathname.split("/read/")[1].split("/chapter/")[0].split("-")[0];
  18. var ficHome = "https://www.scribblehub.com/series/"+ficID+"/";
  19. if(document.querySelectorAll('div#page div.wi_fic_wrap.chapter div.wi_breadcrumb.chapter a[href^="'+ficHome+'"]').length!=0){
  20. UBaddContinueReadingAnywhereButton(ficID);
  21. }
  22. ficID = ficHome = null;
  23. })();
  24.  
  25. function UBaddContinueReadingAnywhereButton(ficID) {
  26. var readURL = "https://www.scribblehub.com/readfirst/"+ficID+"/";
  27. var mobHeader = document.querySelectorAll('div#page div.ol_mb_header span[style="float:right;"]');
  28.  
  29. if(mobHeader.length!=0){
  30. var btnElemMobile = '<span class="ol_h_i"><a onclick="hide_mm_bar();" href="'+readURL+'"><i class="fa fa-reply fa-rotate-180 fa-flip-horizontal" aria-hidden="true" style="color:#fff;font-size:20px;"></i></a></span>'
  31. mobHeader[0].insertAdjacentHTML("beforeend", btnElemMobile);
  32. readURL = mobHeader = btnElemMobile = null;
  33. }else{
  34. var btnElemDesktop = '<a dp="yes" class="btn_settings" title="Continue Reading from Bookmarked Chapter" href="'+readURL+'"><i dp="yes" class="fa fa-reply fa-rotate-180 fa-flip-horizontal" aria-hidden="true"></i></a>'
  35. document.querySelectorAll('div#page div.wi_fic_wrap.chapter div#primary main div.c_set')[0].insertAdjacentHTML("beforeend", btnElemDesktop);
  36. readURL = mobHeader = btnElemDesktop = null;
  37. }
  38. }