Greasy Fork is available in English.

copia cookie

copia i cookie della pagina negli appunti

  1. // ==UserScript==
  2. // @name copia cookie
  3. // @author figuccio
  4. // @version 0.2
  5. // @description copia i cookie della pagina negli appunti
  6. // @namespace https://greasyfork.org/users/237458
  7. // @match *://*/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com
  9. // @grant GM_setClipboard
  10. // @noframes
  11. // @grant GM_addStyle
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @license MIT
  15. // ==/UserScript==
  16. (function() {
  17. 'use strict';
  18. let Container = document.createElement('div');
  19. Container.id = "get-cookie-current_url";
  20. Container.title ="copia negli appunti";
  21. Container.style.position="absolute"
  22. Container.style.left="550px"
  23. Container.style.top="0px"
  24. Container.style['z-index']="99999999999"
  25. Container.innerHTML =`<button id="but-get-cookie-current_url" style="position:absolute;background:green;color:red;">Copia cookie</button>`
  26.  
  27. document.body.appendChild(Container);
  28. //////////////////////////////////////funzione alert
  29. const button = document.getElementById('but-get-cookie-current_url');
  30. button.addEventListener('click', function() {
  31. alert('copiato!');
  32. });
  33. /////////////////////////////////////////////////////////////
  34. var btn;
  35. var current_cookies;
  36. btn = document.getElementById('but-get-cookie-current_url');
  37. btn.onclick = function (){
  38. current_cookies=document.cookie;
  39. GM_setClipboard(current_cookies);
  40. return;
  41. };
  42.  
  43. })();