Test Site

w0w

目前为 2024-07-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Test Site
  3. // @namespace https://www.google.com
  4. // @version 2024-07-27
  5. // @description w0w
  6. // @author Google
  7. // @match *://www.google.com/search?q=test&*
  8. // @match *://www.google.com/search?q=test
  9. // @match *://www.google.com/search?q=testing&*
  10. // @match *://www.google.com/search?q=testing
  11. // @match *://www.google.com/search?q=testing%20testing&*
  12. // @match *://www.google.com/search?q=testing%20testing
  13. // @match *://www.google.com/search?q=testing%20testing%20123&*
  14. // @match *://www.google.com/search?q=testing%20testing%20123
  15. // @match *://www.google.com/search?q=testing+testing&*
  16. // @match *://www.google.com/search?q=testing+testing
  17. // @match *://www.google.com/search?q=testing+testing+123&*
  18. // @match *://www.google.com/search?q=testing+testing+123
  19. // @icon https://t0.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://google.com&size=64
  20. // @grant none
  21. // @run-at document-start
  22. // @license MIT
  23. // ==/UserScript==
  24.  
  25. webpage = `<title>Testing Site</title>
  26. <style>
  27. /* latin */
  28. @font-face {
  29. font-family: 'Product Sans';
  30. font-style: normal;
  31. font-weight: 100;
  32. src: local('Product Sans Thin'), local('ProductSans-Thin'), url(https://fonts.gstatic.com/s/productsans/v9/aXL-Qz25m_FkY0KDMUoO01dBB84BqlWy1BjOnCrU9PY.woff2) format('woff2');
  33. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  34. }
  35. /* latin */
  36. @font-face {
  37. font-family: 'Product Sans';
  38. font-style: normal;
  39. font-weight: 300;
  40. src: local('Product Sans Light'), local('ProductSans-Light'), url(https://fonts.gstatic.com/s/productsans/v9/N0c8y_dasvG2CzM7uYqPLk4GofcKVZz6wtzX_QUIqsI.woff2) format('woff2');
  41. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  42. }
  43. /* latin */
  44. @font-face {
  45. font-family: 'Product Sans';
  46. font-style: normal;
  47. font-weight: 400;
  48. src: local('Product Sans'), local('ProductSans-Regular'), url(https://fonts.gstatic.com/s/productsans/v9/HYvgU2fE2nRJvZ5JFAumwegdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
  49. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  50. }
  51. /* latin */
  52. @font-face {
  53. font-family: 'Product Sans';
  54. font-style: normal;
  55. font-weight: 500;
  56. src: local('Product Sans Medium'), local('ProductSans-Medium'), url(https://fonts.gstatic.com/s/productsans/v9/N0c8y_dasvG2CzM7uYqPLs1Lch-SD8r0CsJ60meulZ8.woff2) format('woff2');
  57. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  58. }
  59. /* latin */
  60. @font-face {
  61. font-family: 'Product Sans';
  62. font-style: normal;
  63. font-weight: 700;
  64. src: local('Product Sans Bold'), local('ProductSans-Bold'), url(https://fonts.gstatic.com/s/productsans/v9/N0c8y_dasvG2CzM7uYqPLnNuWYKPzoeKl5tYj8yhly0.woff2) format('woff2');
  65. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  66. }
  67. /* latin */
  68. @font-face {
  69. font-family: 'Product Sans';
  70. font-style: normal;
  71. font-weight: 900;
  72. src: local('Product Sans Black'), local('ProductSans-Black'), url(https://fonts.gstatic.com/s/productsans/v9/N0c8y_dasvG2CzM7uYqPLtDLwwZd-mS_8JqJ_KGXwxs.woff2) format('woff2');
  73. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
  74. }
  75. </style>
  76. <style>
  77. .center-text {
  78. text-align: center;
  79. margin-top: -5%;
  80. font-size: 250%;
  81. font-weight: 500;
  82. color: #5f6368;
  83. }
  84. body {
  85. font-family: 'Product Sans';
  86. font-weight: 500;
  87. color: #5f6368;
  88. }
  89. </style>
  90.  
  91. <img style="width: 10%; margin-top: -3%; margin-left: -1.5%;" src="https://cdn.myportfolio.com/8f34bb40c4834b701ac4b5a453c80f35/c9838308-dd3d-49d1-8fda-faf48ff3381d_rw_1200.gif?h=3bcf6150647d23823fec951cf30e182e">
  92. <p class="center-text">Testing? I see!</p>
  93. <p class="center-text" style="font-size: 125%; margin-top: -3%; font-weight: 200;">Here! Have some help:</p>
  94. <p style="font-weight: 200; font-size: 175%; margin-top: 4%; margin-left: 5%;">Your IP</p>
  95. <p style="font-size: 175%; margin-top: -2%; margin-left: 5%;" id="ip">ip</p>
  96. <a style="color: #4285f5; font-size: 125%; font-weight: 500; position: fixed; bottom: 0; left: 0; padding: 1%;" id="link">Depart the Testing Site</a>`;
  97.  
  98. document.open();
  99. document.write(webpage);
  100. document.close();
  101.  
  102. var xmlHttp = new XMLHttpRequest();
  103. xmlHttp.open( "GET", "https://api.ipify.org", false );
  104. xmlHttp.send( null );
  105. document.getElementById("ip").innerText = xmlHttp.responseText;
  106.  
  107. document.getElementById("link").href = "https://www.google.com/search?q=+" + window.location.href.split("://www.google.com/search?q=")[1].split("&")[0] + "+"