一鍵獲取網站cookie

一鍵獲取當前網頁cookie,並自動釋放設置於剪切板,可直接粘貼粘貼使用(獲取按鈕位於頁面左下角)。

目前為 2022-11-25 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name GetThecookie
  3. // @name:zh-CN 一键获取网站cookie
  4. // @name:zh-TW 一鍵獲取網站cookie
  5. // @name:zh-HK 一鍵獲取網站cookie
  6. // @namespace https://www.techwb.cn/software/
  7. // @version 1.2
  8. // @description Get the cookie of the current web page with one click, and automatically release it and set it on the clipboard, which can be directly pasted and used (the get button is located in the lower left corner of the page).
  9. // @description:zh-CN 一键获取当前网页cookie,并且自动放置于剪切板,可直接粘贴使用(获取按钮位于页面左下角)。
  10. // @description:zh-TW 一鍵獲取當前網頁cookie,並自動釋放設置於剪切板,可直接粘貼粘貼使用(獲取按鈕位於頁面左下角)。
  11. // @description:ja 現在の Web ページの Cookie をワンクリックで取得でき、取得ボタンの位置は左下隅にあり、ボタンをクリックすると、現在のページの Cookie がクリップボードに置かれます.
  12. // @author Techwb.cn
  13. // @match http*://*
  14. // @include http*://*
  15. // @icon https://www.techwb.cn/logo.png
  16. // @grant GM_setClipboard
  17. // @license none
  18. // ==/UserScript==
  19.  
  20. (function() {
  21. 'use strict';
  22. var lang = navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
  23. var btn={};
  24. switch (lang){
  25. case "zh-CN":
  26. case "zh-SG":
  27. btn={
  28. btname:"获取网站"
  29. };
  30. break;
  31. case "zh-TW":
  32. case "zh-HK":
  33. btn={
  34. btname:"獲取網站"
  35. };
  36. break;
  37. default:
  38. btn={
  39. btname:"THEWEB"
  40. };
  41. break;
  42. }
  43.  
  44. // Your code here...
  45.  
  46. let Container = document.createElement('div');
  47. Container.id = "getcookie";
  48. Container.style.position="fixed"
  49. Container.style.color="red"
  50. Container.style.left="0px"
  51. Container.style.top="92%"
  52. Container.style['z-index']="999999"
  53. Container.innerHTML =`
  54. <span style="font-size:19px;">▶</span>
  55. <div style="padding: 2px; border: 1px solid #aaa; border-radius: 21px; float: right; background: #fff; position: relative; ">
  56. <button id="getcookie"
  57. style="background-image:url(https://XXX.jpg);
  58. padding: 2px;
  59. width: 60px;
  60. height: auto;
  61. background-repeat:no-repeat;
  62. background-size:62px;
  63. border:0;
  64. background-color:transparent;
  65. background:red;
  66. border-radius:41px;
  67. font-size:14px;
  68. color:#fff;
  69. text-align:center;">Cookie</button>
  70. <div style="position: absolute;
  71. width: 62px;
  72. text-align: center;
  73. top: -21px;
  74. left: 0px;
  75. color: #ff8000;
  76. font-weight: bold;
  77. font-size: 14px;
  78. text-shadow: #fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0;">${btn.btname}</div>
  79. </div>
  80. `
  81. /*
  82. ==另一种样式==
  83. <span style="font-size:25px;">▶</span>
  84. <div style="padding: 6px; border: 1px solid #aaa; border-radius: 21px; float: right; background: #fff; position: relative; ">
  85. <button id="getcookie"
  86. style="
  87. background-image:url(https://XXX.jpg);
  88. padding: 6px;
  89. width: auto;
  90. height: auto;
  91. background-repeat:no-repeat;
  92. background-size:62px;
  93. border:0;
  94. background-color:transparent;
  95. background:red;
  96. border-radius:41px;
  97. font-size:12px;
  98. color:#fff;
  99. text-align:center;
  100. ">获取Cookie</button>
  101. </div>
  102. ==/另一种样式==
  103. */
  104.  
  105.  
  106. document.body.appendChild(Container);
  107. var b;
  108. var current_cookies;
  109. b = document.getElementById('getcookie');
  110. b.onclick = function (){
  111. current_cookies=document.cookie;
  112. GM_setClipboard(current_cookies);
  113. return;
  114. };
  115.  
  116. })();

QingJ © 2025

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