For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to install Tampermonkey and the WebRTC debug script

Installing Tampermonkey in Chrome and adding a custom script

Installing Tampermonkey

To run custom scripts in Chrome, it is convenient to use the Tampermonkey extension.

Go to the Chrome Web Store and install the extension:

After installation, click the extensions icon in the upper-right corner and pin Tampermonkey.

The extension is only needed to run the script in the browser. By itself, it does not fix WebRTC leaks.

How to add the script manually

For this guide, use the script from Gist:

1

Open the Gist with the script

Open the Gist link.

Open the script file and copy its full contents.

2

Create a new script in Tampermonkey

Click the Tampermonkey icon and select Create a new script.

Delete the default template that opens in the editor.

3

Paste the script code

Paste the copied code from Gist into the Tampermonkey editor.

Save the changes with Ctrl + S or the File → Save button.

4

Check that the script is enabled

Make sure the new script appears in the Tampermonkey list and has the Enabled status.

How to check that the script works

  1. Make sure the script toggle is enabled.

  2. Refresh the target page.

  3. Open DevTools with F12.

  4. Go to the Console tab.

  5. It is convenient to filter output by the \[TM], \[WebRTC], and \[NET] labels.

What logs should appear

Immediately after the script starts, service messages usually appear:

If the page creates an RTCPeerConnection, WebRTC logs will appear in the console:

During candidate gathering, local and remote candidates will be visible:

If the connection reaches route selection, the script will show the final path:

If the website sends WebRTC data through fetch, xhr, WebSocket, or sendBeacon, the script will show that as well:

What to look at first

  • \[TM] WebRTC hook installed - the script loaded successfully.

  • \[WebRTC] created - the page really created a WebRTC connection.

  • \[WebRTC] local candidate parsed - a local candidate is visible.

  • \[WebRTC] remote candidate parsed - a remote candidate is visible.

  • \[WebRTC] REAL REMOTE ENDPOINT - the most useful log. It shows the final remote endpoint selected by WebRTC.

If there are few logs

This script adds two manual console commands:

The first command prints the selected paths again.

The second shows a full snapshot of candidate-pair, local-candidate, remote-candidate, and transport.

Useful checks after installation

After starting the script, you can check WebRTC behavior using the services from the article How to check for WebRTC leaks.

If you want to understand the leak mechanism itself, see How a WebRTC leak works.

Last updated

Was this helpful?