Second Tab

this is a second tab script

  1. // ==UserScript==
  2. // @name Second Tab
  3. // @namespace https://greasyfork.org/en/users/1188196
  4. // @version 3.4
  5. // @description this is a second tab script
  6. // @match *://www.google.com/*
  7.  
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. var url = prompt("Enter a website remamber to add https:// ");
  13. var b = document.createElement("iframe");
  14. b.style.height = "700px";
  15. b.style.width = "1200px";
  16. b.src = "https://"+url;
  17. b.style.border = "solid white 2px";
  18. b.style.position = "fixed";
  19. b.style.top = "0";
  20. b.style.bottom = "0";
  21. b.style.zIndex = "99999";
  22. b.style.borderRadius = "10px";
  23.  
  24.  
  25. var d = document.createElement("button");
  26. d.style.height = "40px";
  27. d.style.color= "white";
  28. d.style.width = "60px";
  29. d.innerText = "Close";
  30. d.style.background = "red";
  31. d.style.fontWeight = "bold";
  32. b.style.border = "solid white 2px";
  33. d.style.position = "fixed";
  34. d.style.top = "0";
  35. d.style.marginLeft = "642px";
  36. d.style.bottom = "0";
  37. d.style.zIndex = "99999";
  38. d.style.borderRadius = "5px";
  39.  
  40.  
  41. document.body.appendChild(b);
  42. document.body.appendChild(d);
  43.  
  44. d.addEventListener("mouseover",function(){
  45. d.style.filter = "brightness(150%)";
  46. });
  47.  
  48. d.addEventListener("mouseout",function(){
  49. d.style.filter = "brightness(100%)";
  50. })
  51.  
  52. d.addEventListener("click",function(){
  53. document.body.removeChild(d);
  54. document.body.removeChild(b);
  55. clearInterval(t);
  56. })
  57. var t = 0;
  58. function c(){
  59. url = b.src;
  60. console.log(url);
  61. }
  62. t = setInterval(c,100);