diff --git a/apps/app-frontend/package.json b/apps/app-frontend/package.json index 185e2263c..5bd0edc65 100644 --- a/apps/app-frontend/package.json +++ b/apps/app-frontend/package.json @@ -1,7 +1,7 @@ { "name": "@modrinth/app-frontend", "private": true, - "version": "0.8.8", + "version": "0.8.9", "type": "module", "scripts": { "dev": "vite", diff --git a/apps/app/Cargo.toml b/apps/app/Cargo.toml index e5a317caa..409038c07 100644 --- a/apps/app/Cargo.toml +++ b/apps/app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus_gui" -version = "0.8.8" +version = "0.8.9" description = "The Modrinth App is a desktop application for managing your Minecraft mods" license = "GPL-3.0-only" repository = "https://github.com/modrinth/code/apps/app/" diff --git a/apps/app/src/api/ads-init.js b/apps/app/src/api/ads-init.js index 060e7ba4c..33af81a17 100644 --- a/apps/app/src/api/ads-init.js +++ b/apps/app/src/api/ads-init.js @@ -21,86 +21,3 @@ document.addEventListener( window.open = (url, target, features) => { window.top.postMessage({ modrinthOpenUrl: url }, 'https://modrinth.com') } - -function muteAudioContext() { - if (window.AudioContext || window.webkitAudioContext) { - const AudioContext = window.AudioContext || window.webkitAudioContext - const originalCreateMediaElementSource = AudioContext.prototype.createMediaElementSource - const originalCreateMediaStreamSource = AudioContext.prototype.createMediaStreamSource - const originalCreateMediaStreamTrackSource = AudioContext.prototype.createMediaStreamTrackSource - const originalCreateBufferSource = AudioContext.prototype.createBufferSource - const originalCreateOscillator = AudioContext.prototype.createOscillator - - AudioContext.prototype.createGain = function () { - const gain = originalCreateGain.call(this) - gain.gain.value = 0 - return gain - } - - AudioContext.prototype.createMediaElementSource = function (mediaElement) { - const source = originalCreateMediaElementSource.call(this, mediaElement) - source.connect(this.createGain()) - return source - } - - AudioContext.prototype.createMediaStreamSource = function (mediaStream) { - const source = originalCreateMediaStreamSource.call(this, mediaStream) - source.connect(this.createGain()) - return source - } - - AudioContext.prototype.createMediaStreamTrackSource = function (mediaStreamTrack) { - const source = originalCreateMediaStreamTrackSource.call(this, mediaStreamTrack) - source.connect(this.createGain()) - return source - } - - AudioContext.prototype.createBufferSource = function () { - const source = originalCreateBufferSource.call(this) - source.connect(this.createGain()) - return source - } - - AudioContext.prototype.createOscillator = function () { - const oscillator = originalCreateOscillator.call(this) - oscillator.connect(this.createGain()) - return oscillator - } - } -} - -function muteVideo(mediaElement) { - let count = Number(mediaElement.getAttribute('data-modrinth-muted-count') ?? 0) - - if (!mediaElement.muted || mediaElement.volume !== 0) { - mediaElement.muted = true - mediaElement.volume = 0 - - mediaElement.setAttribute('data-modrinth-muted-count', count + 1) - } - - if (count > 5) { - // Video is detected as malicious, so it is removed from the page - mediaElement.remove() - } -} - -function muteVideos() { - document.querySelectorAll('video, audio').forEach(function (mediaElement) { - muteVideo(mediaElement) - - if (!mediaElement.hasAttribute('data-modrinth-muted')) { - mediaElement.addEventListener('volumechange', () => muteVideo(mediaElement)) - - mediaElement.setAttribute('data-modrinth-muted', 'true') - } - }) -} - -document.addEventListener('DOMContentLoaded', () => { - muteVideos() - muteAudioContext() - - const observer = new MutationObserver(muteVideos) - observer.observe(document.body, { childList: true, subtree: true }) -}) diff --git a/apps/app/tauri.conf.json b/apps/app/tauri.conf.json index 8310598d8..6d8614a98 100644 --- a/apps/app/tauri.conf.json +++ b/apps/app/tauri.conf.json @@ -49,7 +49,7 @@ ] }, "productName": "Modrinth App", - "version": "0.8.8", + "version": "0.8.9", "mainBinaryName": "Modrinth App", "identifier": "ModrinthApp", "plugins": { diff --git a/packages/app-lib/Cargo.toml b/packages/app-lib/Cargo.toml index 3f7103296..0b75ca8bd 100644 --- a/packages/app-lib/Cargo.toml +++ b/packages/app-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus" -version = "0.8.8" +version = "0.8.9" authors = ["Jai A "] edition = "2021"