From 019a286c58df2c3d9b83ecb70852d7519a75b040 Mon Sep 17 00:00:00 2001 From: murdle Date: Sun, 14 Dec 2025 01:06:45 +0200 Subject: [PATCH] revert screenshare patch --- assets/public/custom/rtcPatcher.js | 47 ------------------- assets/public/index.html | 3 +- .../public/thirdparty/a74dc785e34cd951968f.js | 4 -- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 assets/public/thirdparty/a74dc785e34cd951968f.js diff --git a/assets/public/custom/rtcPatcher.js b/assets/public/custom/rtcPatcher.js index 52c77fe0..276c7498 100644 --- a/assets/public/custom/rtcPatcher.js +++ b/assets/public/custom/rtcPatcher.js @@ -64,51 +64,4 @@ function addFingerprintToSdp(sdp) { } return result.join("\n"); -} - -if (window.location.pathname.startsWith("/channel")) { - const observer = new MutationObserver(() => { - const screenshareButton = document.querySelector('[aria-label="Share your screen"]'); - if (screenshareButton) { - screenshareButton.addEventListener("click", async () => { - try { - const displayStream = await navigator.mediaDevices.getDisplayMedia({ - video: { - width: { ideal: 1920 }, - height: { ideal: 1080 }, - frameRate: { ideal: 30 } - }, - audio: false - }); - - const audioStream = await navigator.mediaDevices.getUserMedia({ - audio: { - echoCancellation: { ideal: true }, - autoGainControl: { ideal: true }, - noiseSuppression: { ideal: true } - } - }); - - const combinedStream = new MediaStream(); - - displayStream.getVideoTracks().forEach(track => { - combinedStream.addTrack(track); - }); - - audioStream.getAudioTracks().forEach(track => { - combinedStream.addTrack(track); - }); - - displayStream.getVideoTracks()[0].onended = () => { - audioStream.getTracks().forEach(track => track.stop()); - }; - } catch (error) { - console.error("Screenshare failed:", error); - } - }, { once: true }); - observer.disconnect(); - } - }); - - observer.observe(document.body, { childList: true, subtree: true }); } \ No newline at end of file diff --git a/assets/public/index.html b/assets/public/index.html index a13630af..66b95854 100644 --- a/assets/public/index.html +++ b/assets/public/index.html @@ -70,7 +70,8 @@ HTML_TIMESTAMP: Date.now(), ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0", GATEWAY_ENDPOINT: data.gateway.baseUrl, - VAPID_KEY: data.vapid.publicKey + VAPID_KEY: data.vapid.publicKey, + GATEWAY_URL: data.gateway.baseUrl }; const customScripts = [ diff --git a/assets/public/thirdparty/a74dc785e34cd951968f.js b/assets/public/thirdparty/a74dc785e34cd951968f.js deleted file mode 100644 index 0a4d97a4..00000000 --- a/assets/public/thirdparty/a74dc785e34cd951968f.js +++ /dev/null @@ -1,4 +0,0 @@ -(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[52816],{652816:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=void 0;var r,n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=c(t);if(o&&o.has(e))return o.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e;o&&o.set(e,r);return r}(o(667294)),a=d(o(956117)),i=o(772575),l=o(645758),u=o(3400),f=d(o(247001)),s=d(o(265960));function d(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(c=function(e){return e?o:t})(e)}function p(e,t,o,n){r||(r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103) -;var a=e&&e.defaultProps,i=arguments.length-3;if(t||0===i||(t={children:void 0}),1===i)t.children=n;else if(i>1){for(var l=new Array(i),u=0;u{e.exports=o.p+"cba6ebb8b9ef28d31f0e570eeee6a16a.svg"}}]); -//# sourceMappingURL=a74dc785e34cd951968f.js.map \ No newline at end of file