Example Test

Replace all of https://example.com/ with a blank page displaying "test" and set the page title to "test"

  1. // ==UserScript==
  2. // @name Example Test
  3. // @namespace https://redcodi.com/
  4. // @version 1.0
  5. // @description Replace all of https://example.com/ with a blank page displaying "test" and set the page title to "test"
  6. // @author Redcodi
  7. // @license MIT
  8. // @match https://example.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Remove all existing styles and scripts
  16. document.head.innerHTML = '';
  17. document.body.innerHTML = '';
  18.  
  19. // Load Google Fonts Roboto
  20. var fontLink = document.createElement('link');
  21. fontLink.rel = 'stylesheet';
  22. fontLink.href = 'https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap';
  23. document.head.appendChild(fontLink);
  24.  
  25. // Replace the entire page content
  26. document.body.innerHTML = '<p style="font-family: Roboto, sans-serif;">test</p>';
  27.  
  28. // Set the page title to "test"
  29. document.title = 'test';
  30.  
  31. // Change the favicon to a test icon
  32. var link = document.createElement('link');
  33. link.rel = 'icon';
  34. link.href = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="80" font-size="80">Σ</text></svg>';
  35. document.head.appendChild(link);
  36. })();

QingJ © 2025

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