- Author:
oliwer.christ02@sap.com - License: MIT
- Namespace: consistent identifier across all scripts
- Match patterns: be specific but not overly restrictive
- Use descriptive
@descriptionfields without dates - Include
@iconpointing to relevant favicons - Version format: X.X or X.X.X
- Tabs for indentation, single quotes, semicolons
- Max line length: 180 characters
- ES2025+ (const/let, arrow functions, template literals, optional chaining)
- Prefer IIFEs for script isolation
- camelCase for variables/functions, PascalCase for classes, UPPER_CASE for constants
- Prefix event handlers with
handleoron
- Include all needed
@grantdirectives — only what's strictly used - Use
@run-at document-idlefor most scripts - Add
@downloadURLand@updateURLfor automatic updates - Use
GM_setValue/GM_getValuefor preferences, never store sensitive user data - Use appropriate
@connectdirectives for CORS
- Use MutationObserver for dynamic content, not polling
- Use modern selectors (
querySelector,querySelectorAll) - Check element existence before manipulation
- Use event delegation; clean up listeners and dynamically created elements
- try-catch for risky operations, fail silently for DOM manipulations that may break on page changes
- Debounce frequent events (resize, scroll, input)
- Clean up event listeners and observers
- Run
npm run lintbefore committing - Use
npm run countto track script sizes