📄 SKILL.md

← Vault

name: tampermonkey-script-debug

description: Debug Tampermonkey userscript when UI button/injection doesn't appear on target page


Tampermonkey Script Debug — Browser Button Not Appearing

Trigger

When a Tampermonkey userscript (*.user.js) is installed but its UI element (button/toast/injection) doesn't appear on the target page, and the script's logic seems correct.

Diagnosis Steps (in order)

1. Verify script is actually installed

Tampermonkey Dashboard → confirm script shows "Enabled" and "Installed" (not "Error")

2. Check @match covers the URL

Open DevTools (F12) → Console, type:

`javascript

location.href

`

Confirm the URL matches the @match pattern in the script header (e.g. https://app2.paineldocorretor.com.br/crm/*)

3. Check if script is running at all

Look for script's console prefix (e.g. [RSSyncV3]) in DevTools Console. If no prefix messages appear, script is not executing.

4. Check for DOM elements created by script

`javascript

document.getElementById('rssync-toast'); // or the element ID used by script

`

5. Verify @match pattern in Resources tab

Tampermonkey Dashboard → script → Resources tab → confirm the @match URL covers the current page URL.

6. Force update the script

The browser may be running a cached old version. Tampermonkey Dashboard → "Check for updates" OR uninstall and reinstall from the raw URL.

Critical Discovery: Terminal Display Masking

Problem: grep or cat in terminal may display a URL as https:...oken making it look corrupted. This is terminal visual masking of URLs, NOT actual file corruption.

Fix: Use Python byte-level reading to verify actual file contents:

`python

with open(path, 'rb') as f:

data = f.read()

Find the URL bytes

idx = data.find(b'https://auth.')

print(data[idx:idx+80])

`

Known Tools