Example Safe User Script

This script highlights all links on a webpage by changing their background color to yellow.

Verze ze dne 22. 04. 2025. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Example Safe User Script
  3. // @namespace https://www.example.com/
  4. // @version 1.0
  5. // @description This script highlights all links on a webpage by changing their background color to yellow.
  6. // @author Your Name
  7. // @match https://www.example.com/*
  8. // @grant none
  9. // @license MIT
  10. // @antifeature none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Add a simple feature to highlight all links on the page
  17. const links = document.querySelectorAll('a');
  18. links.forEach(link => {
  19. link.style.backgroundColor = 'yellow';
  20. });
  21. console.log("All links have been highlighted!");
  22. })();