Sleazy Fork is available in English.

JavBus Copy Button

Add a copy button to the JavBus project to make it easy for mobile Safari to copy.

  1. // ==UserScript==
  2. // @name JavBus Copy Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Add a copy button to the JavBus project to make it easy for mobile Safari to copy.
  6. // @author loveJav
  7. // @match https://www.javbus.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=javbus.com
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const tab = document.getElementById("magnet-table");
  16.  
  17. if(!tab){
  18. return;
  19. }
  20.  
  21. const interval = setInterval(() => {
  22. const rows = tab.querySelectorAll("tr");
  23.  
  24. if(rows.length === 1) {
  25. return;
  26. console.log(1)
  27. }
  28.  
  29. clearInterval(interval);
  30.  
  31. for(let i = 1; i < rows.length; i++) {
  32.  
  33. const row = rows[i];
  34. const a = row.children[0].children[0];
  35. const link = a.getAttribute('href');
  36.  
  37. const cell = document.createElement('td');
  38. const button = document.createElement('button');
  39.  
  40. button.textContent = 'Copy';
  41.  
  42. button.style.textAlign = 'center';
  43. button.style.cursor = 'pointer';
  44. button.style.color = '#fff';
  45. button.style.background = 'linear-gradient(45deg, #2196F3 30%, #21CBF3 90%)';
  46. button.style.border = 'none';
  47. button.style.borderRadius = '3px';
  48. button.style.transition = '0.3s';
  49.  
  50. button.onclick = function() {
  51. navigator.clipboard.writeText(link)
  52. .then(() => {
  53. alert('Copy successful!');
  54. })
  55. .catch(err => {
  56. console.error('Could not copy text: ', err);
  57. });
  58. };
  59.  
  60. cell.appendChild(button);
  61. row.appendChild(cell);
  62. }
  63. }, 100);
  64. })();