Skip to content

Kiy0w0/Astra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Astra

Astra! Pop-up Blocker

A powerful, high-performance pop-up blocker for Chrome and Firefox (Manifest V3). Inspired by Ichika Hoshino & Wonderhoy from Project Sekai, this extension combines aggressive blocking techniques with a clean, hand-crafted UI.

Why Another Blocker?

Most pop-up blockers fail against modern, aggressive ad networks because they operate in the browser's "isolated world" (where standard content scripts run). This means page scripts can still easily bypass them using obfuscated window.open calls or synthetic clicks.

Astra solves this by injecting its core interceptor directly into the MAIN world. It lives alongside the website's own scripts, allowing it to hook directly into native APIs before the page even loads.

How It Works

  1. MAIN World Interception (src/lib/page-inject.js) We patch native browser APIs directly in the page context:

    • Overrides window.open to return a dummy WindowProxy, neutralizing pop-ups and preventing script errors.
    • Patches EventTarget.prototype.dispatchEvent to detect and ignore synthetic clicks.
    • Intercepts string-based setTimeout/setInterval calls that try to evaluate window.open.
    • Hooks into Location.prototype.href to stop sneaky cross-origin redirects.
    • Enforces a strict 1200ms "gesture TTL"—if a user click didn't happen recently, new windows are blocked.
  2. Overlay Mask Neutralization Aggressive sites often place transparent <div> overlays across the entire screen to hijack your first click. Using document.elementsFromPoint, Astra detects these invisible traps and strips their pointer events instantly.

  3. Background Tab Monitoring The service worker watches for tabs that open to about:blank and abruptly navigate away (the classic "pop-under" pattern) and immediately kills them.

  4. Network Level (DNR) Uses Chrome's declarativeNetRequest API to kill requests to 25+ notorious pop-up/pop-under ad networks (PopAds, PropellerAds, Monetag, ExoClick, etc.) at the engine level.

Development & Build

Astra is built with Vanilla HTML/CSS, but uses TypeScript and esbuild for compiling the MAIN world injector.

Prerequisites: Node.js 18+

# Install dependencies
npm install

# Build the TypeScript injector
npm run build

# Or watch for changes during development
npm run watch

Installation

Chrome / Edge / Brave / Chromium

  1. Open chrome://extensions and enable Developer mode.
  2. Click Load unpacked and select the root rappier directory.

Firefox

  1. Open about:debuggingThis Firefox.
  2. Click Load Temporary Add-on and select manifest.json.

Mizu Network

Releases

No releases published

Packages

 
 
 

Contributors