Select Website

1 tap to select the hole website, 2 taps to copy

  1. // ==UserScript==
  2. // @name Select Website
  3. // @namespace http://example.com
  4. // @version 1.3
  5. // @description 1 tap to select the hole website, 2 taps to copy
  6. // @author L.M.M.
  7. // @match *://*/*
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. let button = document.createElement('button');
  14. button.innerText = "Select Text";
  15. button.style.position = "fixed";
  16. button.style.bottom = "20px";
  17. button.style.right = "20px";
  18. button.style.zIndex = "1000";
  19. button.style.padding = "10px";
  20. button.style.backgroundColor = "#34302D";
  21. button.style.color = "white";
  22. button.style.border = "none";
  23. button.style.borderRadius = "5px";
  24. button.style.boxShadow = "0px 2px 4px rgba(0,0,0,0.2)";
  25. button.style.fontSize = "16px";
  26. button.style.cursor = "pointer";
  27.  
  28. button.addEventListener('click', function() {
  29. let body = document.body;
  30.  
  31. let sel = window.getSelection();
  32. let range = document.createRange();
  33. range.selectNodeContents(body);
  34. sel.removeAllRanges();
  35. sel.addRange(range);
  36. });
  37.  
  38. document.body.appendChild(button);
  39. })();