JavDB & MissAv Jumper

Combine waterfall layout and jump button for JavDB

  1. // ==UserScript==
  2. // @name JavDB & MissAv Jumper
  3. // @namespace https://javdb.com/
  4. // @version 3.0
  5. // @description Combine waterfall layout and jump button for JavDB
  6. // @license MIT
  7. // @author YourName
  8. // @match https://javdb.com/*
  9. // @match https://missav.ws/*
  10. // @grant GM_addStyle
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // @grant GM_deleteValue
  14. // @grant GM_notification
  15. // @grant GM_setClipboard
  16. // @grant GM_getResourceURL
  17. // @grant GM_registerMenuCommand
  18. // @grant GM_info
  19. // @grant GM_openInTab
  20. // @grant GM_xmlhttpRequest
  21. // @connect *
  22. // @run-at document-idle
  23. // ==/UserScript==
  24.  
  25. (function() {
  26. 'use strict';
  27.  
  28. // JavDB Jump Button Code
  29. var jumpButton = document.createElement('button');
  30. jumpButton.style.backgroundColor = 'green';
  31. jumpButton.style.color = 'white';
  32. jumpButton.style.position = 'fixed';
  33. jumpButton.style.bottom = '10px';
  34. jumpButton.style.left = '10px';
  35. jumpButton.style.zIndex = '9999';
  36. jumpButton.style.padding = '16px 24px';
  37. jumpButton.style.borderRadius = '8px';
  38. jumpButton.style.fontSize = '24px';
  39. jumpButton.style.border = 'none';
  40. jumpButton.style.cursor = 'pointer';
  41. jumpButton.style.display = 'none';
  42.  
  43. jumpButton.addEventListener('click', function() {
  44. let 番號 = '';
  45. let url = '';
  46. if (window.location.href.includes('javdb.com')) {
  47. var link = document.querySelector('.panel-block.first-block a.button.is-white.copy-to-clipboard');
  48. if (link) {
  49. 番號 = link.getAttribute('data-clipboard-text');
  50. if (番號) {
  51. url = "https://missav.ws/" + 番號.toLowerCase();
  52. }
  53. }
  54. } else if (window.location.href.includes('missav.ws')) {
  55. var element = document.querySelector('.text-secondary span.font-medium');
  56. if (element) {
  57. 番號 = element.innerText;
  58. 番號 = 番號.replace(/-UNCENSORED-LEAK|-CHINESE-SUBTITLE/g, '');
  59. url = "https://javdb.com/search?f=all&q=" + 番號;
  60. }
  61. }
  62. if (番號 && url) {
  63. var a = document.createElement('a');
  64. a.href = url;
  65. a.target = '_blank';
  66. a.style.display = 'none';
  67. document.body.appendChild(a);
  68. a.click();
  69. document.body.removeChild(a);
  70. }
  71. });
  72.  
  73. let 番號 = '';
  74. if (window.location.href.includes('javdb.com')) {
  75. var link = document.querySelector('.panel-block.first-block a.button.is-white.copy-to-clipboard');
  76. if (link) {
  77. 番號 = link.getAttribute('data-clipboard-text');
  78. }
  79. } else if (window.location.href.includes('missav.ws')) {
  80. var element = document.querySelector('.text-secondary span.font-medium');
  81. if (element) {
  82. 番號 = element.innerText;
  83. 番號 = 番號.replace(/-UNCENSORED-LEAK|-CHINESE-SUBTITLE/g, '');
  84. }
  85. }
  86.  
  87. if (番號) {
  88. jumpButton.innerHTML = 番號;
  89. jumpButton.style.display = 'block';
  90. } else {
  91. jumpButton.style.display = 'none';
  92. }
  93.  
  94. document.body.appendChild(jumpButton);
  95. })();