Skip to content

Make ad blocking harder#1925

Draft
RohitKushvaha01 wants to merge 9 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:main
Draft

Make ad blocking harder#1925
RohitKushvaha01 wants to merge 9 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:main

Conversation

@RohitKushvaha01
Copy link
Member

No description provided.

@RohitKushvaha01 RohitKushvaha01 marked this pull request as draft March 7, 2026 13:26
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR promotes hideAd from a method on the helpers object into a standalone named export in src/lib/startAd.js, then updates all 12 call-sites across pages and components to import and call it directly. The motivation ("make ad blocking harder") is that a property on the widely-accessible helpers object is easier for plugins or runtime interceptors to monkey-patch than a module-scoped named export.

Key changes:

  • hideAd logic is moved verbatim from helpers.js to startAd.js as a named export — no behavioral change.
  • All page components (about, changelog, customTheme, fileBrowser, fontManager, plugin, plugins, problems, quickTools, themeSetting, adRewards, settingsPage) and removeAds.js are updated to import { hideAd } from lib/startAd and call it directly.
  • helpers.showAd() is intentionally left in place (only hideAd needed the protection).
  • Two unrelated dependency bumps are bundled into the PR: @biomejs/biome is loosened from an exact pin (2.1.4) to a caret range (^2.1.4), and cordova-android is upgraded from ^14.0.1 to ^15.0.0 — a major-version jump that also raises the minimum Node.js requirement.

Confidence Score: 3/5

  • The ad-blocking refactor itself is safe, but the unrelated cordova-android major version bump warrants verification before merging.
  • The core hideAd extraction is a mechanical, logic-preserving refactor across 12 files and looks correct. The two bundled dependency changes — especially the cordova-android 14→15 major-version bump — are unrelated to the PR goal and raise the minimum Node.js requirement, which could silently break CI environments on Node 20.5–20.16.
  • package.json and package-lock.json — the cordova-android major version bump should be reviewed separately to confirm the build environment meets the new >=20.17.0 || >=22.9.0 requirement.

Important Files Changed

Filename Overview
src/lib/startAd.js Adds a new hideAd named export whose logic is identical to the removed helpers.hideAd; uses tag as an implicit global consistent with the rest of the codebase.
src/lib/removeAds.js Replaces helpers.hideAd(true) with the direct hideAd(true) import; relative path ./startAd.js is correct since both files live in src/lib/.
src/utils/helpers.js Cleanly removes the hideAd method that has been promoted to a named export in startAd.js; no other usages of hideAd remain here.
package.json Contains two unrelated dependency changes: @biomejs/biome pinning loosened to ^2.1.4 and cordova-android bumped from ^14.0.1 to ^15.0.0 (a major-version jump with new Node.js requirements).
src/components/settingsPage.js Straightforward swap of helpers.hideAd() for the new named hideAd() import; no functional change.
src/pages/plugins/plugins.js Replaces helpers.hideAd() with hideAd() from lib/startAd; helpers is still used for toInternalUri and errorMessage, so the import is not orphaned.
src/pages/about/about.js Replaces helpers.hideAd() with hideAd(); helpers.showAd() on the last line retains the helpers import legitimately.
src/pages/adRewards/index.js Replaces forced helpers.hideAd(true) with hideAd(true) from lib/startAd; no other concerns.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before
        H1[helpers.js\nhideAd method]
        P1[Pages / Components] -->|helpers.hideAd| H1
    end

    subgraph After
        SA[startAd.js\nexport hideAd]
        H2[helpers.js\nshowAd only]
        P2[Pages / Components] -->|import hideAd from lib/startAd| SA
        P2 -->|helpers.showAd| H2
    end
Loading

Last reviewed commit: e2356c4

RohitKushvaha01 and others added 4 commits March 10, 2026 11:41
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
RohitKushvaha01 and others added 2 commits March 10, 2026 13:51
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@RohitKushvaha01
Copy link
Member Author

@greptileai

@RohitKushvaha01 RohitKushvaha01 added CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. and removed CI: RUN ON-DEMAND PREVIEW RELEASES Triggers an on-demand preview build for this pull request via CI workflow. labels Mar 10, 2026
@RohitKushvaha01
Copy link
Member Author

Waiting for cordova-android@15 support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant