Disable P2P feature (WebRTC)

disable p2p connection on all page

  1. // ==UserScript==
  2. // @name Disable P2P feature (WebRTC)
  3. // @namespace https://github.com/NateScarlet/Scripts/tree/master/user-script
  4. // @description disable p2p connection on all page
  5. // @grant unsafeWindow
  6. // @run-at document-start
  7. // @include *
  8. // @version 2024.12.09+7b896c9c
  9. // ==/UserScript==
  10.  
  11. "use strict";
  12. (() => {
  13. // src/disable-p2p.user.ts
  14. ((win = window) => {
  15. delete win.RTCPeerConnection;
  16. delete win.mozRTCPeerConnection;
  17. delete win.webkitRTCPeerConnection;
  18. delete win.RTCDataChannel;
  19. delete win.DataChannel;
  20. })(unsafeWindow);
  21. })();