Dive Into Greasemonkey

Teaching an old web new tricks

List of examples

  1. Example: helloworld.user.js
  2. Example: Hello World metadata
  3. Example: Display the “Hello world!” alert
  4. Example: Bad way to delay calling a function
  5. Example: Better way to delay calling a function
  6. Example: Best way to delay calling a function
  7. Example: Write to JavaScript Console and continue (gmlog.user.js)
  8. Example: Introduction to Javascript Shell
  9. Example: Get properties of an element
  10. Example: Metadata tags to match a domain and all subdomains
  11. Example: Alert the user if the GM_xmlhttpRequest function is not available
  12. Example: Check if the page contains a <textarea>
  13. Example: Loop through every element
  14. Example: Find all the textareas on a page
  15. Example: Find all the links on a page
  16. Example: Find all the elements with a title attribute
  17. Example: Find all <div>s with a class of sponsoredlink
  18. Example: The xpath function
  19. Example: Insert an <hr> before the main content
  20. Example: Insert an <hr> after the navigation bar
  21. Example: Remove an ad sidebar
  22. Example: Replace an image with its alt text
  23. Example: Insert a banner at the top of the page
  24. Example: Add a graphical logo at the top of the page
  25. Example: Make paragraph text larger
  26. Example: Get the styles defined by an element's style attribute
  27. Example: Get the actual style of an element
  28. Example: Setting style on a single element
  29. Example: Replace an entire page with custom content
  30. Example: Find all forms whose method is "POST" or "post"
  31. Example: Get the current domain
  32. Example: Add a query parameter to the end of a link
  33. Example: Redirect a site to its secure counterpart
  34. Example: Do something when the user clicks anywhere on the page
  35. Example: Do something before a form is submitted
  36. Example: Parse an arbitrary string as XML
  37. Example: Parse XML from a remote source
  38. Example: Redirect GMail to an equivalent https:// address
  39. Example: Make Bloglines display all unread items automatically
  40. Example: aintitreadable.user.js
  41. Example: offsiteblank.user.js
  42. Example: dumbquotes.user.js
  43. Example: frownies.user.js
  44. Example: zoomtextarea.user.js
  45. Example: accessbar.user.js
← List of tips
List of procedures →