Sleazy Fork is available in English.

Remove Javbus Banner Ad

Remove the banner ad at the top of javbus.com and make copy instead of open scheme

  1. // ==UserScript==
  2. // @name Remove Javbus Banner Ad
  3. // @namespace Violentmonkey Scripts
  4. // @version 0.2
  5. // @description Remove the banner ad at the top of javbus.com and make copy instead of open scheme
  6. // @author TAB
  7. // @match *://*.javbus.com/*
  8. // @license GNU GPLv3
  9. // @grant GM_setClipboard
  10. // ==/UserScript==
  11.  
  12. function copyMagnet(){
  13. // 获取所有包含指定 onclick 事件的 <td> 元素
  14. var tdElements = document.querySelectorAll('td[onclick^="window.open(\'magnet"]');
  15.  
  16. // 遍历每个 <td> 元素
  17. tdElements.forEach(function(td) {
  18. // 获取 magnet 链接
  19. var magnetLink = td.getAttribute('onclick').match(/'([^']+)'/)[1];
  20.  
  21. // 移除原有点击事件
  22. td.removeAttribute('onclick');
  23.  
  24. // 添加新的点击事件,复制 magnet 链接到剪贴板
  25. td.addEventListener('click', function() {
  26. GM_setClipboard(magnetLink);
  27. console.log('Magnet link copied to clipboard:', magnetLink);
  28. });
  29. });
  30. }
  31.  
  32.  
  33. (function() {
  34. 'use strict';
  35.  
  36.  
  37. // 创建一个 MutationObserver 实例,监听页面内容的变化
  38. var observer = new MutationObserver(function(mutationsList) {
  39. // 当页面内容发生变化时执行以下操作
  40. mutationsList.forEach(function(mutation) {
  41. // 检查变化是否与 AJAX 请求有关
  42. if (mutation.type === 'childList') {
  43. // 在这里可以执行你想要的操作,例如修改页面内容、添加新元素等
  44. console.log('Page content changed after AJAX request');
  45.  
  46. copyMagnet();
  47.  
  48. var banner = document.querySelector('.ad-box');
  49. if (banner) {
  50. banner.remove();
  51. }
  52. }
  53. });
  54. });
  55.  
  56. // 启动 MutationObserver 监听页面内容的变化
  57. observer.observe(document.body, { childList: true, subtree: true });
  58.  
  59.  
  60. })();