Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: 24
cache: npm
Expand All @@ -37,12 +37,12 @@ jobs:
run: npm run test:e2e
- name: Package
run: node scripts/package.mjs
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: shieldfix-extension
path: release/*.zip
if-no-files-found: error
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
if: failure()
with:
name: playwright-report
Expand Down
6 changes: 3 additions & 3 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ listing, and is a major version.
- [ ] Brave’s extension page shows no errors for ShieldFix.
7. **Package:** `npm run package` → `release/shieldfix-<version>.zip` and `.sha256`. The script refuses version
mismatches and test builds.
8. **Store assets (if UI changed):** `npm run build:e2e && node scripts/store-assets.mjs` regenerates
`store-assets/` (1280×800 screenshots plus popup/dashboard previews).
8. **Store assets (if UI changed):** `npm run store-assets` regenerates
`store-assets/` (five 1280×800 screenshots and the promo tiles).
9. **Tag and publish:** tag `v<version>`, attach the zip and checksum to the release, and submit the zip to stores.

## Chrome Web Store submission notes
Expand All @@ -45,7 +45,7 @@ ShieldFix is prepared for, but has not been through, Chrome Web Store review. Wh
- **Data usage:** no data collected; certify compliance with the developer program policies only after reviewing them
for the current submission.
- **Privacy policy URL:** host [PRIVACY.md](../PRIVACY.md) at a public URL.
- Listing text: see [STORE_LISTING.md](STORE_LISTING.md).
- Field-by-field values and listing text: see [STORE_LISTING.md](STORE_LISTING.md).

Store policies change; review the current Chrome Web Store program policies (in particular those on ad blockers and on
modifying third-party sites) before each submission. Brave installs extensions from the Chrome Web Store.
125 changes: 102 additions & 23 deletions docs/STORE_LISTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,112 @@
# Store listing (draft)
# Chrome Web Store submission sheet

**Name:** ShieldFix
Copy-paste values for every field of the Chrome Web Store developer dashboard. Brave installs extensions from the
Chrome Web Store, so this one listing serves Brave, Chrome and other Chromium browsers.

**Short description (≤ 132 characters):**
Detects anti-adblock warnings and offers reversible, user-approved fixes. Private by design: everything stays on your device.
## Before you start (one time)

**Category:** Privacy & Security
1. Sign in at <https://chrome.google.com/webstore/devconsole> with the Google account that will own the listing.
2. Accept the developer agreement and pay the one-time registration fee.
3. Turn on 2-Step Verification for the account (required to publish).
4. Fill in the **Account** tab (publisher name, contact email — verify it).

**Detailed description:**
## 1. Package

Websites increasingly react to ad and tracker blocking with full-screen “please disable your ad blocker” walls, banners
and broken players. ShieldFix helps you keep your protection on.
- **New item → upload** `release/shieldfix-<version>.zip` (`npm run package`), or the zip attached to the
[GitHub release](https://github.com/Dszae/ShieldFix/releases/latest).
- Never upload `dist-e2e/` — it is a test build (the package script refuses to zip it).

- Recognises anti-adblock warnings and tells them apart from cookie banners, sign-in dialogs, subscription prompts and
ordinary pop-ups.
- Explains what it found and why, with a clear confidence level.
- Offers the least invasive fix: hide the warning, restore scrolling and remove blur — only when you approve it, and
always reversible with one click. Ads and trackers stay blocked.
- Remembers fixes for sites you choose, with rules you can review, edit, roll back, export or delete.
- Explains how to adjust Brave Shields for a single site when a cosmetic fix is not enough. ShieldFix never changes your
protection itself.
- Optional automatic detection for the sites you pick.
## 2. Store listing tab

Privacy: no data collection, no analytics, no network requests, no account. Everything runs and stays on your device.
| Field | Value |
| ------------------ | --------------------------------------------------------------- |
| Title | from the package: `ShieldFix` |
| Summary | from the package (manifest description, ≤ 132 characters) |
| Category | Privacy & Security |
| Language | English |
| Store icon | `public/icons/icon-128.png` |
| Screenshots (1–5) | `store-assets/screenshot-1.png` … `screenshot-5.png` (1280×800) |
| Small promo tile | `store-assets/promo-small.png` (440×280) |
| Marquee promo tile | `store-assets/promo-marquee.png` (1400×560) |
| Homepage URL | `https://github.com/Dszae/ShieldFix` |
| Support URL | `https://github.com/Dszae/ShieldFix/issues` |

ShieldFix does not bypass paywalls, logins or subscription requirements.
Regenerate the images with `npm run store-assets`.

**Screenshots (1280×800):** `store-assets/store-1-detect.png`, `store-assets/store-2-rules.png`,
`store-assets/store-3-privacy.png`.
**Description** (paste as-is):

**Icon:** `public/icons/icon-128.png`. Promotional imagery: `docs/images/banner.png`, `docs/images/before-after.png`,
`docs/images/demo.gif` (regenerate with `npm run media`).
```text
Websites increasingly answer ad and tracker blocking with full-screen "Ad blocker detected — please disable your ad blocker" walls, blurred articles and locked scrolling. ShieldFix lets you keep your protection on and still use the page.

WHAT IT DOES
• Detects anti-adblock walls, banners and video-player warnings, with a clear confidence score.
• Tells them apart from cookie banners, sign-in dialogs, subscription prompts and ordinary pop-ups — those are never touched.
• Offers the least invasive fix: hide the warning, restore scrolling and remove the blur. You review exactly what changes before anything happens.
• Fully reversible: one click on Undo (or a page reload) restores the page exactly. Nothing is deleted, and ads and trackers stay blocked.
• "Always apply on this site" saves a local rule you can review, edit, roll back, export or delete.
• Optional automatic detection for the sites you choose, with a small in-page notice.
• Explains how to adjust Brave Shields for a single site when a cosmetic fix is not enough. ShieldFix never changes your protection itself.

PRIVATE BY DESIGN
• No data collection, no analytics, no account, no network requests.
• No access to any website at install — ShieldFix only reads a page when you click its button, or on sites you choose to watch.
• Open source: https://github.com/Dszae/ShieldFix

WHAT IT DOES NOT DO
ShieldFix does not bypass paywalls, logins, subscription requirements or DRM, and it cannot restore content a site never loaded.
```

## 3. Privacy practices tab

**Single purpose description**

```text
ShieldFix detects anti-adblock warnings on web pages (messages asking the user to disable their ad blocker) and, with the user's approval, hides them with a reversible cosmetic change.
```

**Permission justifications**

| Permission | Justification (paste) |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `storage` | Stores the user's settings, per-site preferences, compatibility rules and an optional local history on the device. Nothing is transmitted. |
| `activeTab` | When the user clicks the toolbar button, ShieldFix scans the current tab for an anti-adblock warning and, if the user approves, hides it. No access to any other tab. |
| `scripting` | Injects the detection script into the active tab after the user clicks the toolbar button, and registers it for sites the user explicitly chose to watch. |
| Host permissions | Optional only, never requested at install. Requested at runtime when the user turns on "Watch this site" (that site only) or "Watch all sites", so warnings can be detected automatically as pages load. Revocable at any time. |

**Are you using remote code?** No, I am not using remote code.

**Data usage:** tick **none** of the data categories (ShieldFix collects no user data). Then tick all three
certifications (no selling to third parties; no use unrelated to the single purpose; no use for creditworthiness or
lending) — they are true for ShieldFix.

**Privacy policy URL:** `https://github.com/Dszae/ShieldFix/blob/main/PRIVACY.md`

## 4. Distribution tab

- Payments: **Free**
- Visibility: **Public**
- Regions: **All regions**

## 5. Test instructions (optional, helps reviewers)

```text
1. Open any news page that shows an "Ad blocker detected" wall while an ad blocker or Brave Shields is active.
2. Click the ShieldFix toolbar button. The popup reports the warning and its confidence.
3. Click "Review suggested fix" to see the planned changes, then "Apply reversible fix". The wall is hidden and scrolling restored.
4. Click "Undo fix" — the page is restored exactly.
On pages without a warning (or with only a cookie banner or login form) ShieldFix reports "No issue detected" and offers no fix.
No account or login is required.
```

## 6. Submit

Click **Submit for review**. Leave “publish automatically after review” on if you want it live as soon as it passes.

Notes:

- Extensions with broad (even optional) host permissions may receive an in-depth review, which can take longer.
- Answer reviewer questions using [PERMISSIONS.md](PERMISSIONS.md) and [PRIVACY.md](../PRIVACY.md).
- **Updates:** bump `version` in `package.json`, run `npm run package`, and upload the new zip on the item's
**Package** tab. The version must increase with every upload.
- **Microsoft Edge Add-ons** (<https://partner.microsoft.com/dashboard/microsoftedge>) accepts the same zip and
the same texts.
4 changes: 1 addition & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ export default tseslint.config(
rules: { 'no-restricted-properties': 'off', '@typescript-eslint/no-non-null-assertion': 'off' },
},
{
// Playwright fixtures call `use()`, which is not a React hook.
files: ['tests/e2e/**/*.ts'],
rules: { 'react-hooks/rules-of-hooks': 'off' },
rules: { 'react-hooks/rules-of-hooks': 'off', 'no-empty-pattern': 'off' },
},
{
files: ['scripts/**/*.mjs', 'tests/e2e/**/*.mjs', '*.config.{js,ts}'],
extends: [js.configs.recommended],
// Callbacks passed to Playwright's page.evaluate() run in the browser.
languageOptions: { globals: { ...globals.node, ...globals.browser, ...globals.webextensions } },
},
);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"test:watch": "vitest",
"test:e2e": "npm run build && npm run build:e2e && playwright test",
"icons": "node scripts/generate-icons.mjs",
"assets": "npm run build:e2e && node scripts/store-assets.mjs",
"package": "npm run build && node scripts/package.mjs",
"check": "npm run typecheck && npm run lint && npm run format:check && npm run test && npm run build",
"media": "npm run build:e2e && node scripts/readme-media.mjs"
"media": "npm run build:e2e && node scripts/readme-media.mjs",
"store-assets": "npm run build:e2e && node scripts/store-assets.mjs"
},
"dependencies": {
"lucide-react": "1.74.0",
Expand Down
4 changes: 0 additions & 4 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { defineConfig } from '@playwright/test';

/**
* Browser tests load the E2E build (dist-e2e/, created by `npm run build:e2e`)
* into Playwright's Chromium. Set BRAVE_PATH to also run the suite in Brave.
*/
const projects: NonNullable<Parameters<typeof defineConfig>[0]['projects']> = [
{ name: 'chromium', use: { browserName: 'chromium' } },
];
Expand Down
14 changes: 0 additions & 14 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
#!/usr/bin/env node
/**
* Builds the extension with Vite in three passes:
* 1. extension pages (popup, dashboard) — ES modules with shared chunks
* 2. background service worker — single ES module, no shared chunks
* 3. content script — single IIFE (content scripts cannot be modules)
* then writes manifest.json with the version from package.json.
*
* node scripts/build.mjs production build -> dist/
* node scripts/build.mjs --e2e test build -> dist-e2e/ (adds host access to 127.0.0.1 only)
* node scripts/build.mjs --watch rebuild on change
*/
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -93,9 +82,6 @@ async function writeManifest() {
const manifest = JSON.parse(await readFile(resolve(root, 'src/manifest.json'), 'utf8'));
manifest.version = pkg.version;
if (e2e) {
// Test builds only: grant access to the local fixture server (and the reserved
// example.com domain, mapped to it when recording README media) so automated
// tests can inject without a toolbar click. Never used for release builds.
manifest.name = 'ShieldFix (E2E test build)';
manifest.host_permissions = ['*://127.0.0.1/*', '*://*.example.com/*'];
}
Expand Down
5 changes: 0 additions & 5 deletions scripts/generate-icons.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env node
/**
* Renders the ShieldFix icon (vector source below) to PNG at every size the
* manifest needs, using Playwright's Chromium. Run with `npm run icons`.
* Small sizes use a simplified, heavier mark so they stay legible.
*/
import { mkdir } from 'node:fs/promises';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down
9 changes: 2 additions & 7 deletions scripts/package.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env node
/**
* Packages dist/ into release/shieldfix-<version>.zip for distribution and prints
* its SHA-256. Refuses to package a test build. Pure Node (no zip dependency).
*/
import { createHash } from 'node:crypto';
import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
import { dirname, join, relative, resolve, sep } from 'node:path';
Expand Down Expand Up @@ -46,7 +42,6 @@ async function walk(dir) {
return out;
}

// Fixed timestamp (2025-01-01 00:00) so identical inputs produce identical archives.
const DOS_TIME = 0;
const DOS_DATE = ((2025 - 1980) << 9) | (1 << 5) | 1;

Expand All @@ -61,8 +56,8 @@ for (const file of await walk(dist)) {
const local = Buffer.alloc(30);
local.writeUInt32LE(0x04034b50, 0);
local.writeUInt16LE(20, 4);
local.writeUInt16LE(0x0800, 6); // UTF-8 names
local.writeUInt16LE(8, 8); // deflate
local.writeUInt16LE(0x0800, 6);
local.writeUInt16LE(8, 8);
local.writeUInt16LE(DOS_TIME, 10);
local.writeUInt16LE(DOS_DATE, 12);
local.writeUInt32LE(crc, 14);
Expand Down
21 changes: 0 additions & 21 deletions scripts/readme-media.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
#!/usr/bin/env node
/**
* Generates the README media in docs/images/ from the real extension (E2E build):
* demo.gif popup flow: detect -> review -> apply -> scroll
* auto-detect.gif watched site: warning appears, in-page notice, one-click hide
* *.png popup, dashboard, before/after, banner (also used as social preview)
*
* Pages are the local test fixtures, served under the reserved example.com domain via
* Chromium's host resolver rules. Requires ffmpeg on PATH for the GIFs.
*
* npm run build:e2e && node scripts/readme-media.mjs
*/
import { execFileSync, spawn } from 'node:child_process';
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
import { dirname, join, resolve } from 'node:path';
Expand All @@ -23,7 +12,6 @@ const ext = resolve(root, 'dist-e2e');
const PORT = 4173;
const site = (host, page) => `http://${host}.example.com:${PORT}/${page}.html`;

/* ----------------------------------------------------------------- server */
async function up() {
try {
return (await fetch(`http://127.0.0.1:${PORT}/health`)).ok;
Expand Down Expand Up @@ -69,7 +57,6 @@ try {
await send({ type: 'settings/update', patch: { theme: 'light' } });
const icon = `data:image/png;base64,${(await readFile(resolve(root, 'public/icons/icon-32.png'))).toString('base64')}`;

/* ------------------------------------------------- 1. demo.gif (popup) */
const page = await context.newPage();
await page.setViewportSize({ width: 1280, height: 751 });
const demoUrl = site('news', 'fullscreen-modal');
Expand Down Expand Up @@ -217,7 +204,6 @@ try {
);
gif(['-f', 'concat', '-safe', '0', '-i', join(work, 'demo.txt')], join(out, 'demo.gif'));

// Before / after stills from the same page.
await page.evaluate(() => window.scrollTo(0, 0));
await sleep(150);
const after = await page.screenshot();
Expand All @@ -241,7 +227,6 @@ try {
await sleep(200);
await stage.screenshot({ path: join(out, 'before-after.png') });

/* ------------------------------------- 2. auto-detect.gif (monitoring) */
await send({ type: 'site/update', hostname: 'recipes.example.com', patch: { monitor: true } });
await send({ type: 'monitoring/sync' });
const live = await context.newPage();
Expand Down Expand Up @@ -287,10 +272,8 @@ try {
const liveVideo = live.video();
await live.close();
const webm = await liveVideo.path();
// Skip the blank frames recorded before the first paint.
gif(['-ss', '0.6', '-i', webm], join(out, 'auto-detect.gif'));

/* ----------------------------------------- 3. data for dashboard shots */
for (const [host, name] of [
['tech', 'banner'],
['video', 'video-error'],
Expand All @@ -312,7 +295,6 @@ try {
}
await p.close();
}
// A rule arriving through the real import path (validated, disabled, marked "Imported").
await send({
type: 'rules/import',
payload: {
Expand All @@ -329,7 +311,6 @@ try {
},
});

/* ----------------------------------------------------- 4. screenshots */
const popupShot = async (url, file, prepare) => {
const p = await context.newPage();
await p.setViewportSize({ width: 368, height: 640 });
Expand Down Expand Up @@ -360,7 +341,6 @@ try {
await p.getByRole('heading', { name: 'Diagnosis' }).waitFor();
});
await send({ type: 'settings/update', patch: { developerMode: false } });
// The popup shots above undid the saved fix; re-enable its rule for the dashboard shots.
const rules = await send({ type: 'rules/list' });
for (const r of rules.data.filter((x) => x.domain === 'news.example.com')) {
await send({ type: 'rules/setEnabled', id: r.id, enabled: true });
Expand All @@ -380,7 +360,6 @@ try {
await helper.screenshot({ path: join(out, `dashboard-${section}-${theme}.png`) });
}

/* ------------------------------------------------- 5. banner (1280x640) */
await send({ type: 'settings/update', patch: { theme: 'dark' } });
const darkPopup = await readFile(join(out, 'popup-dark.png'));
const logo = (await readFile(resolve(root, 'public/icons/icon-128.png'))).toString('base64');
Expand Down
Loading
Loading