Copy Simply Johnny's

I just wanna copy something

  1. // ==UserScript==
  2. // @name Copy Simply Johnny's
  3. // @namespace bambooom
  4. // @version 0.3
  5. // @description I just wanna copy something
  6. // @author bambooom
  7. // @homepageURL https://zhuzi.dev
  8. // @supportURL https://zhuzi.dev
  9. // @license MIT
  10. // @match https://*.johnnys-net.jp/*
  11. // @match https://*.johnnys-web.com/*
  12. // @match https://*.johnny-associates.co.jp/*
  13. // @match https://johnnys-shop.jp/*
  14. // @match https://*.johnnys-shop.jp/*
  15. // @match https://j-island.net/*
  16. // @match https://*.j-island.net/*
  17. // @run-at document-end
  18. // @grant unsafeWindow
  19. // ==/UserScript==
  20.  
  21. (function() {
  22. let css = `
  23. body{
  24. user-select: auto!important;
  25. }
  26. h1, h2, h3, h4, h5, p, span, img {
  27. user-select: auto!important;
  28. }
  29. *:not(input) {
  30. user-select: auto!important;
  31. }
  32.  
  33. .visually-hidden {
  34. border: 0;
  35. clip: rect(0,0,0,0);
  36. position: absolute;
  37. width: 1px;
  38. height: 1px;
  39. margin: -1px;
  40. overflow: hidden;
  41. padding: 0;
  42. }
  43. `;
  44. let styleNode = document.createElement("style");
  45. styleNode.appendChild(document.createTextNode(css));
  46. (document.querySelector("head") || document.documentElement).appendChild(styleNode);
  47.  
  48. let donot = [...document.querySelectorAll('script')].filter(n => /donot\.js$/.test(n.src));
  49. if (donot.length) {
  50. donot[0].remove();
  51. }
  52. unsafeWindow.KEY_ENABLE = 1;
  53. unsafeWindow.________J && unsafeWindow.________J.doNot({
  54. selectContent: null,
  55. captureImages: null,
  56. useContextMenu: null,
  57. useKeys: null,
  58. });
  59.  
  60. if (/johnnys-web\.com/.test(unsafeWindow.location.hostname)) {
  61. unsafeWindow.navigator.userAgent = 'Mozilla/5.0 (iPad; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
  62. unsafeWindow.navigator.appVersion = '5.0 (iPad; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
  63. //location.href = 'https://www.johnnys-web.com/s/jwb/?ima=4442';
  64. var post = document.querySelector('.entry__content .entry__body');
  65. if (post) {
  66. post = post.textContent.trim();
  67. var row = document.querySelector('.entry__posted_on');
  68. var color = getComputedStyle(document.querySelector('.blog .section-article .entry__date')).color;
  69. var btn = document.createElement('button');
  70. btn.style.color = color;
  71. btn.style.border = 'solid 2px ' + color;
  72. btn.style.borderRadius = '3px';
  73. btn.style.padding = '4px 6px';
  74. btn.textContent = 'Copy Full Text';
  75. row.appendChild(btn);
  76. var input = document.createElement('textarea');
  77. input.classList.add('visually-hidden');
  78. input.id = 'copy-full-text';
  79. document.body.appendChild(input);
  80. btn.onclick = function () {
  81. input.value = post;
  82. input.select();
  83. let success = document.execCommand('copy');
  84. window.getSelection().removeAllRanges();
  85. if (success) {
  86. console.log('copied');
  87. }
  88. };
  89. }
  90. }
  91. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址