~/Tampermonkey Tips and Tricks
Nov 14, 2020
Use Tampermonkey to run custom user scripts in your browser. Here are practical tips:
Install reliable scripts
Only get scripts from trusted sources like Greasy Fork to avoid malware.
Manage script order
Scripts can override each other. Go to the dashboard and drag to change priority.
Use metadata for targeting
Scripts run on pages matched in the @match
or @include
block.
Test with console logs
Debug by using console.log()
in your code. Open Developer Tools to see outputs.
Auto update scripts
Enable auto-update in settings to keep scripts secure and working.
Isolate scope
Wrap code with an immediately invoked function expression to avoid polluting the window namespace.
Store data with GM setValue
Use GM setValue and GM getValue to save data between sessions.
By following these best practices you can harness Tampermonkey effectively.