SMBC-comics reading helper

Shows the hover title immediately and the red button panel after a delay to help reading the Saturday Morning Breakfast Cereal web comics.

当前为 2022-08-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name SMBC-comics reading helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 1
  5. // @description Shows the hover title immediately and the red button panel after a delay to help reading the Saturday Morning Breakfast Cereal web comics.
  6. // @author andrybak
  7. // @license MIT
  8. // @match https://www.smbc-comics.com/comic/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=smbc-comics.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. /*
  14. * Copyright (c) 2022 Andrei Rybak
  15. *
  16. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17. * of this software and associated documentation files (the "Software"), to deal
  18. * in the Software without restriction, including without limitation the rights
  19. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20. * copies of the Software, and to permit persons to whom the Software is
  21. * furnished to do so, subject to the following conditions:
  22. *
  23. * The above copyright notice and this permission notice shall be included in all
  24. * copies or substantial portions of the Software.
  25. *
  26. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  27. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  28. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  29. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  30. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  31. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34.  
  35. (function() {
  36. 'use strict';
  37.  
  38. // using jQuery from the site itself
  39. $(document).ready(() => {
  40. if ($("#cc-comic").length > 0) {
  41. const text = $("#cc-comic").prop('title');
  42. $('#cc-comicbody').append(`<div style="clear:both;"><span style="font-family:'Comic Sans MS';font-size:150%;">${text}</span></div>`);
  43. }
  44. setTimeout(() => {
  45. $('#extracomic').click();
  46. }, 2000);
  47. });
  48. })();