Disable P2P feature (WebRTC)

disable p2p connection on all page

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name     Disable P2P feature (WebRTC)
// @namespace https://github.com/NateScarlet/Scripts/tree/master/user-script
// @description disable p2p connection on all page
// @grant    unsafeWindow
// @run-at   document-start
// @include	 *
// @version   2024.12.09+7b896c9c
// ==/UserScript==

"use strict";
(() => {
  // src/disable-p2p.user.ts
  ((win = window) => {
    delete win.RTCPeerConnection;
    delete win.mozRTCPeerConnection;
    delete win.webkitRTCPeerConnection;
    delete win.RTCDataChannel;
    delete win.DataChannel;
  })(unsafeWindow);
})();