Disable P2P feature (WebRTC)

disable p2p connection on all page (for firefox, go to `about:config` and set `media.peerconnection.enabled` to false instead)

目前為 2023-05-08 提交的版本,檢視 最新版本

  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 (for firefox, go to `about:config` and set `media.peerconnection.enabled` to false instead)
  5. // @grant none
  6. // @run-at document-start
  7. // @include *
  8. // @version 2023.05.08+e4375f89
  9. // ==/UserScript==
  10.  
  11. (() => {
  12. // src/disable-p2p.user.ts
  13. delete window.RTCPeerConnection;
  14. delete window.mozRTCPeerConnection;
  15. delete window.webkitRTCPeerConnection;
  16. delete window.RTCDataChannel;
  17. delete window.DataChannel;
  18. })();