feat: browser microsoft sign-in, reachable offline and ely.by login
This commit is contained in:
1 parent
61a9b53af6
commit
9f8f11f424
8 files changed
+1003
-139
No files matched your search
@@ -0,0 +1,235 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Modrinth Enhanced <patches@modrinth-enhanced.invalid>
|
||||
Date: Mon, 14 Sep 2026 10:18:37 +0200
|
||||
Subject: [PATCH] Remove advertising and Modrinth+ upsells
|
||||
|
||||
The sidebar ad slot, the ad cookie consent prompt and both "Upgrade to
|
||||
Modrinth+" prompts are gone:
|
||||
|
||||
* `showAd` and `adConsentAvailable` are pinned to false, which takes the
|
||||
ad slot and the consent prompt out of the layout.
|
||||
* The upgrade link above the ad slot and the entry in the account menu
|
||||
are removed outright rather than left behind a false condition.
|
||||
* The sidebar keeps upstream's `has-plus` class unconditionally, which
|
||||
is what stops space being reserved at the bottom for an ad.
|
||||
* With no upsell left to decide about, the request that asked Modrinth
|
||||
whether this account has Modrinth+ goes too.
|
||||
|
||||
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.
|
||||
|
||||
Nothing else in the app is gated behind Modrinth+: it decided whether
|
||||
ads and these prompts were shown, and nothing more.
|
||||
---
|
||||
apps/app-frontend/src/App.vue | 55 ++++-------------------
|
||||
apps/app-frontend/src/helpers/ads.js | 65 +++++++++-------------------
|
||||
2 files changed, 29 insertions(+), 91 deletions(-)
|
||||
|
||||
diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue
|
||||
index a2ae0e6..6e7b27d 100644
|
||||
--- a/apps/app-frontend/src/App.vue
|
||||
+++ b/apps/app-frontend/src/App.vue
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
VerboseLoggingFeature,
|
||||
} from '@modrinth/api-client'
|
||||
import {
|
||||
- ArrowBigUpDashIcon,
|
||||
ArrowLeftRightIcon,
|
||||
ChevronLeftIcon,
|
||||
ChevronRightIcon,
|
||||
@@ -94,7 +93,6 @@ import UpdateToPlayModal from '@/components/ui/modal/UpdateToPlayModal.vue'
|
||||
import NavButton from '@/components/ui/NavButton.vue'
|
||||
import OnboardingChecklist from '@/components/ui/onboarding-checklist/index.vue'
|
||||
import PrideFundraiserBanner from '@/components/ui/PrideFundraiserBanner.vue'
|
||||
-import PromotionWrapper from '@/components/ui/PromotionWrapper.vue'
|
||||
import QuickInstanceSwitcher from '@/components/ui/QuickInstanceSwitcher.vue'
|
||||
import SharedInstanceInviteHandler from '@/components/ui/shared-instances/shared-instance-invite-handler/index.vue'
|
||||
import SplashScreen from '@/components/ui/SplashScreen.vue'
|
||||
@@ -159,7 +157,6 @@ import {
|
||||
syncedServersQueryOptions,
|
||||
} from '@/helpers/synced-options'
|
||||
import { syncedPackQueryOptions } from '@/helpers/synced-packs'
|
||||
-import { hasActivePride26Midas, hasMidasBadge } from '@/helpers/user-campaigns.ts'
|
||||
import { get_user_preferences } from '@/helpers/user-preferences.ts'
|
||||
import { parse_modrinth_user_link } from '@/helpers/users'
|
||||
import {
|
||||
@@ -344,12 +341,6 @@ const tauriApiClient = new TauriModrinthClient({
|
||||
],
|
||||
})
|
||||
provideModrinthClient(tauriApiClient)
|
||||
-const { data: authenticatedModrinthUser } = useQuery({
|
||||
- queryKey: computed(() => ['authenticated-user', 'campaigns', credentials.value?.user?.id]),
|
||||
- queryFn: () => tauriApiClient.labrinth.users_v3.getAuthenticated(),
|
||||
- enabled: () => !!credentials.value?.session,
|
||||
- retry: false,
|
||||
-})
|
||||
useQuery({
|
||||
queryKey: computed(() => instanceKeys.sharedEligibility(credentials.value?.user?.id)),
|
||||
queryFn: can_current_user_use_shared_instances,
|
||||
@@ -360,16 +351,13 @@ useQuery({
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
})
|
||||
-const hasPlus = computed(
|
||||
- () =>
|
||||
- !!credentials.value?.user &&
|
||||
- (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.
|
||||
+// The sidebar keeps upstream's `has-plus` class unconditionally for the same
|
||||
+// reason: that class is what stops space being reserved at the bottom for an
|
||||
+// ad and the gradient being drawn above it.
|
||||
+const showAd = computed(() => false)
|
||||
+const adConsentAvailable = computed(() => false)
|
||||
providePageContext({
|
||||
hierarchicalSidebarAvailable: ref(true),
|
||||
showAds: showAd,
|
||||
@@ -694,10 +682,6 @@ const messages = defineMessages({
|
||||
id: 'app.restarting',
|
||||
defaultMessage: 'Restarting...',
|
||||
},
|
||||
- upgradeToModrinthPlus: {
|
||||
- id: 'app.nav.upgrade-to-modrinth-plus',
|
||||
- defaultMessage: 'Upgrade to Modrinth+',
|
||||
- },
|
||||
news: {
|
||||
id: 'app.news.title',
|
||||
defaultMessage: 'News',
|
||||
@@ -1529,16 +1513,6 @@ const modrinthAccountMenuOptions = computed(() => [
|
||||
icon: UserIcon,
|
||||
action: () => router.push(`/user/${encodeURIComponent(credentials.value.user.username)}`),
|
||||
},
|
||||
- {
|
||||
- id: 'plus',
|
||||
- label: formatMessage(messages.upgradeToModrinthPlus),
|
||||
- icon: ArrowBigUpDashIcon,
|
||||
- type: 'link',
|
||||
- href: 'https://modrinth.plus?app',
|
||||
- target: '_blank',
|
||||
- tone: 'purple',
|
||||
- shown: !hasPlus.value,
|
||||
- },
|
||||
{
|
||||
id: 'add-friend',
|
||||
label: formatMessage(messages.addFriend),
|
||||
@@ -2484,13 +2458,11 @@ provideAppUpdateDownloadProgress(appUpdateDownload)
|
||||
</RouterView>
|
||||
</div>
|
||||
<div
|
||||
- class="app-sidebar mt-px shrink-0 flex flex-col border-0 border-l-[1px] border-[--brand-gradient-border] border-solid"
|
||||
- :class="{ 'has-plus': hasPlus }"
|
||||
+ class="app-sidebar mt-px shrink-0 flex flex-col border-0 border-l-[1px] border-[--brand-gradient-border] border-solid has-plus"
|
||||
>
|
||||
<div
|
||||
v-overlay-scrollbars="sidebarOverlayScrollbarsOptions"
|
||||
class="app-sidebar-scrollable flex-grow shrink relative"
|
||||
- :class="{ 'pb-12': !hasPlus }"
|
||||
data-overlayscrollbars-initialize
|
||||
>
|
||||
<OnboardingChecklist
|
||||
@@ -2552,17 +2524,6 @@ provideAppUpdateDownloadProgress(appUpdateDownload)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
- <template v-if="showAd">
|
||||
- <a
|
||||
- href="https://modrinth.plus?app"
|
||||
- class="absolute bottom-[250px] w-full flex justify-center items-center gap-1 px-4 py-3 text-purple font-medium hover:underline z-10"
|
||||
- target="_blank"
|
||||
- >
|
||||
- <ArrowBigUpDashIcon class="text-2xl" />
|
||||
- {{ formatMessage(messages.upgradeToModrinthPlus) }}
|
||||
- </a>
|
||||
- <PromotionWrapper />
|
||||
- </template>
|
||||
</div>
|
||||
</div>
|
||||
<I18nDebugPanel />
|
||||
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() {}
|
||||
Reference in new issue
Block a user