From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Modrinth Enhanced Date: Mon, 14 Sep 2026 10:18:37 +0200 Subject: [PATCH] Remove advertising The sidebar ad slot, the "Upgrade to Modrinth+" nag above it and the ad cookie consent prompt are all driven by two computed flags in App.vue, so pinning both to false takes the whole surface out of the layout. The helpers in `helpers/ads.js` are additionally stubbed out, which stops the Tauri `ads` plugin from ever being asked to spawn the ad webview, no matter which call site reaches for it. --- apps/app-frontend/src/App.vue | 8 ++-- apps/app-frontend/src/helpers/ads.js | 65 +++++++++------------------- 2 files changed, 25 insertions(+), 48 deletions(-) diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index 1d1a9ce..4df835f 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -366,10 +366,10 @@ const hasPlus = computed( (hasMidasBadge(credentials.value.user) || hasActivePride26Midas(authenticatedModrinthUser.value?.campaigns?.pride_26)), ) -const showAd = computed( - () => sidebarVisible.value && !hasPlus.value && credentials.value !== undefined, -) -const adConsentAvailable = computed(() => credentials.value !== undefined && !hasPlus.value) +// Modrinth Enhanced ships without advertising, so the sidebar ad slot and the +// ad cookie consent flow that only exists to serve it are both switched off. +const showAd = computed(() => false) +const adConsentAvailable = computed(() => false) providePageContext({ hierarchicalSidebarAvailable: ref(true), showAds: showAd, diff --git a/apps/app-frontend/src/helpers/ads.js b/apps/app-frontend/src/helpers/ads.js index 8c85970..96005e6 100644 --- a/apps/app-frontend/src/helpers/ads.js +++ b/apps/app-frontend/src/helpers/ads.js @@ -1,55 +1,32 @@ -import { invoke } from '@tauri-apps/api/core' +/** + * Modrinth Enhanced does not show advertising. + * + * Upstream these helpers forward to the Tauri `ads` plugin, which spawns a + * second webview that loads the ad network and tracks clicks on it. Every + * helper below is a no-op instead, so the plugin is never asked to create + * that webview and the consent flow that exists purely for ad cookies never + * has anything to consent to. + * + * The functions are kept — rather than removed along with their callers — so + * that upstream call sites keep working unchanged. + */ -export async function init_ads_window(overrideShown = false) { - return await invoke('plugin:ads|init_ads_window', { - overrideShown, - dpr: window.devicePixelRatio, - }) -} - -let adsWindowHoldUpdate = Promise.resolve() - -async function update_ads_window_hold(acquire) { - adsWindowHoldUpdate = adsWindowHoldUpdate - .catch(() => {}) - .then(() => - invoke('plugin:ads|update_ads_window_hold', { - acquire, - dpr: window.devicePixelRatio, - }), - ) +export async function init_ads_window() {} - return await adsWindowHoldUpdate -} - -export async function take_ads_window_hold() { - return await update_ads_window_hold(true) -} +export async function take_ads_window_hold() {} -export async function release_ads_window_hold() { - return await update_ads_window_hold(false) -} +export async function release_ads_window_hold() {} -export async function hide_ads_window(reset) { - return await invoke('plugin:ads|hide_ads_window', { reset }) -} +export async function hide_ads_window() {} export async function should_show_ads_consent_popup() { - return await invoke('plugin:ads|should_show_ads_consent_popup') + return false } -export async function perform_ads_consent_action(action) { - return await invoke('plugin:ads|perform_ads_consent_action', { action }) -} +export async function perform_ads_consent_action() {} -export async function open_ads_consent_preferences() { - return await invoke('plugin:ads|open_ads_consent_preferences') -} +export async function open_ads_consent_preferences() {} -export async function record_ads_click() { - return await invoke('plugin:ads|record_ads_click') -} +export async function record_ads_click() {} -export async function open_ads_link(path, origin) { - return await invoke('plugin:ads|open_link', { path, origin }) -} +export async function open_ads_link() {}