feat: hide the Google "preferred source" call-to-action #44

Closed
opened 2026-10-10 12:23:18 +02:00 by midas · 0 comments
Owner

Part of #16. Depends on #18 and #19.

Feature description

Both apps add a call-to-action to articles asking the reader to add the newspaper as a "preferred source" in Google. It is self-promotion with no value inside the app. Hide it.

Findings

de Volkskrant (7.52.0)

  • A GoogleSourceButton article block, injected client-side by nl.persgroep.edition.article.data.converters.GoogleSourceButtonBlockInjector (shouldInject).
  • Simplest hook: make shouldInject return false.

De Gelderlander (9.21.1)

  • PreferredSourceComponent maps in g20.a to i30.g0(id, type, url). Its properties are only type and url.
  • That this is the same Google "preferred source" CTA is likely but unconfirmed. Verify on the device.

Approach

  • Volkskrant: GoogleSourceButtonBlockInjector.shouldInject returns false, or drop the block via #19.
  • Gelderlander: drop PreferredSourceComponent via #18.

Done when

  • Build passes; the patch applies on both apps.
  • Device check (after asking): the CTA is gone from articles in both apps.
  • Documented in both docs/apps/*.md.

Midas Settings

  • Toggle: Verberg "Voorkeursbron"-knop (hide_preferred_source), category "Advertenties en promotie", default on. Same key in both apps.
  • Read in GoogleSourceButtonBlockInjector.shouldInject (Volkskrant) and the article filter (Gelderlander).
  • Needs #49 and the entry point for each app (#50, #51).
Part of #16. Depends on #18 and #19. ## Feature description Both apps add a call-to-action to articles asking the reader to add the newspaper as a "preferred source" in Google. It is self-promotion with no value inside the app. Hide it. ## Findings ### de Volkskrant (7.52.0) - A `GoogleSourceButton` article block, injected client-side by `nl.persgroep.edition.article.data.converters.GoogleSourceButtonBlockInjector` (`shouldInject`). - Simplest hook: make `shouldInject` return false. ### De Gelderlander (9.21.1) - `PreferredSourceComponent` maps in `g20.a` to `i30.g0(id, type, url)`. Its properties are only `type` and `url`. - That this is the same Google "preferred source" CTA is likely but unconfirmed. Verify on the device. ## Approach - Volkskrant: `GoogleSourceButtonBlockInjector.shouldInject` returns false, or drop the block via #19. - Gelderlander: drop `PreferredSourceComponent` via #18. ## Done when - [ ] Build passes; the patch applies on both apps. - [ ] Device check (after asking): the CTA is gone from articles in both apps. - [ ] Documented in both `docs/apps/*.md`. ## Midas Settings - Toggle: **Verberg "Voorkeursbron"-knop** (`hide_preferred_source`), category "Advertenties en promotie", default **on**. Same key in both apps. - Read in `GoogleSourceButtonBlockInjector.shouldInject` (Volkskrant) and the article filter (Gelderlander). - Needs #49 and the entry point for each app (#50, #51).
midas closed this issue 2026-10-10 20:59:31 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/midas-patches#44
No description provided.