atlas-browser 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.github/FUNDING.yml +1 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +26 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +16 -0
  4. package/CONTRIBUTING.md +63 -0
  5. package/LICENSE +21 -0
  6. package/PRIVACY.md +37 -0
  7. package/README.md +163 -0
  8. package/SECURITY.md +29 -0
  9. package/assets/logo.png +0 -0
  10. package/bin/cli.js +142 -0
  11. package/dist-electron/main/blocker.js +109 -0
  12. package/dist-electron/main/blocker.js.map +1 -0
  13. package/dist-electron/main/bookmark-manager.js +121 -0
  14. package/dist-electron/main/bookmark-manager.js.map +1 -0
  15. package/dist-electron/main/download-manager.js +118 -0
  16. package/dist-electron/main/download-manager.js.map +1 -0
  17. package/dist-electron/main/index.js +116 -0
  18. package/dist-electron/main/index.js.map +1 -0
  19. package/dist-electron/main/ipc-handlers.js +303 -0
  20. package/dist-electron/main/ipc-handlers.js.map +1 -0
  21. package/dist-electron/main/menu.js +229 -0
  22. package/dist-electron/main/menu.js.map +1 -0
  23. package/dist-electron/main/security-analyzer.js +71 -0
  24. package/dist-electron/main/security-analyzer.js.map +1 -0
  25. package/dist-electron/main/settings-manager.js +105 -0
  26. package/dist-electron/main/settings-manager.js.map +1 -0
  27. package/dist-electron/main/tab-manager.js +205 -0
  28. package/dist-electron/main/tab-manager.js.map +1 -0
  29. package/dist-electron/main/tor-manager.js +59 -0
  30. package/dist-electron/main/tor-manager.js.map +1 -0
  31. package/dist-electron/preload/preload.js +73 -0
  32. package/dist-electron/preload/preload.js.map +1 -0
  33. package/install.sh +120 -0
  34. package/package.json +67 -0
  35. package/src/main/blocker.ts +121 -0
  36. package/src/main/bookmark-manager.ts +99 -0
  37. package/src/main/download-manager.ts +103 -0
  38. package/src/main/index.ts +93 -0
  39. package/src/main/ipc-handlers.ts +283 -0
  40. package/src/main/menu.ts +192 -0
  41. package/src/main/security-analyzer.ts +97 -0
  42. package/src/main/settings-manager.ts +84 -0
  43. package/src/main/tab-manager.ts +249 -0
  44. package/src/main/tor-manager.ts +59 -0
  45. package/src/preload/preload.ts +85 -0
  46. package/src/renderer/bookmarks.html +84 -0
  47. package/src/renderer/browser-ui.js +427 -0
  48. package/src/renderer/downloads.html +94 -0
  49. package/src/renderer/history.html +111 -0
  50. package/src/renderer/index.html +152 -0
  51. package/src/renderer/internet-map.html +313 -0
  52. package/src/renderer/network-map.js +131 -0
  53. package/src/renderer/security-panel.js +13 -0
  54. package/src/renderer/settings.html +138 -0
  55. package/src/renderer/styles.css +688 -0
  56. package/tsconfig.json +18 -0
@@ -0,0 +1 @@
1
+ github: intergalacticuser
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Something broken? Let me know
4
+ title: '[Bug] '
5
+ labels: bug
6
+ assignees: intergalacticuser
7
+ ---
8
+
9
+ **What happened?**
10
+ A clear description of the bug.
11
+
12
+ **Steps to reproduce**
13
+ 1. Go to '...'
14
+ 2. Click on '...'
15
+ 3. See error
16
+
17
+ **Expected behavior**
18
+ What should have happened instead.
19
+
20
+ **Screenshots**
21
+ If applicable, add screenshots.
22
+
23
+ **Environment**
24
+ - macOS version: [e.g. 14.2]
25
+ - Atlas Browser version: [e.g. 0.2.0-beta]
26
+ - Chip: [e.g. M1, M2, M3]
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Got an idea? I'd love to hear it
4
+ title: '[Feature] '
5
+ labels: enhancement
6
+ assignees: intergalacticuser
7
+ ---
8
+
9
+ **What's the idea?**
10
+ Describe the feature you'd like to see.
11
+
12
+ **Why would this be useful?**
13
+ How would this improve the browser or privacy?
14
+
15
+ **Any implementation ideas?**
16
+ If you've thought about how this could work, share it here.
@@ -0,0 +1,63 @@
1
+ # Contributing to Atlas Browser
2
+
3
+ Thank you for your interest in contributing to Atlas Browser! We're building the most private browser possible and we need your help.
4
+
5
+ ## Getting Started
6
+
7
+ 1. Fork the repository
8
+ 2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/atlas-browser.git`
9
+ 3. Install dependencies: `npm install`
10
+ 4. Run in development: `npm start`
11
+
12
+ ## Development
13
+
14
+ ```bash
15
+ # Compile TypeScript (watches for changes)
16
+ npx tsc
17
+
18
+ # Run the browser
19
+ npx electron .
20
+
21
+ # Build .dmg
22
+ npm run build
23
+ ```
24
+
25
+ ## Project Structure
26
+
27
+ ```
28
+ src/
29
+ main/ # Electron main process (TypeScript)
30
+ index.ts # App entry point
31
+ tab-manager.ts # Tab lifecycle
32
+ blocker.ts # Tracker/ad blocking
33
+ tor-manager.ts # Tor proxy
34
+ ...
35
+ renderer/ # Browser UI (HTML/CSS/JS)
36
+ index.html # Browser chrome
37
+ styles.css # Theme
38
+ browser-ui.js # UI logic
39
+ ...
40
+ preload/ # IPC bridge
41
+ preload.ts # Secure API exposure
42
+ ```
43
+
44
+ ## Guidelines
45
+
46
+ - **Privacy first** - Never add telemetry, analytics, or tracking
47
+ - **Keep it simple** - We prefer less code that does more
48
+ - **Test your changes** - Make sure the browser works before submitting
49
+ - **One PR per feature** - Keep PRs focused
50
+
51
+ ## What We Need Help With
52
+
53
+ - Windows and Linux support
54
+ - Dynamic blocker list updates (EasyList integration)
55
+ - Tab favicon extraction
56
+ - Reader mode
57
+ - Accessibility improvements
58
+ - Performance optimization
59
+ - Documentation and translations
60
+
61
+ ## Code of Conduct
62
+
63
+ Be kind. Be respectful. We're all here to build something good.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Atlasiant
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/PRIVACY.md ADDED
@@ -0,0 +1,37 @@
1
+ # Privacy Policy
2
+
3
+ ## Atlas Browser
4
+
5
+ Atlas Browser collects **zero** user data. Here's exactly what happens:
6
+
7
+ ### What we DON'T do
8
+ - We don't track your browsing history (it's stored locally on your device only)
9
+ - We don't collect analytics or telemetry
10
+ - We don't send crash reports
11
+ - We don't fingerprint your device
12
+ - We don't set cookies
13
+ - We don't share any data with third parties
14
+
15
+ ### What stays on your device
16
+ - Bookmarks (stored in your app data folder)
17
+ - Settings (stored in your app data folder)
18
+ - Download history (stored in your app data folder)
19
+ - Browsing history (stored in your app data folder, cleared on exit by default)
20
+
21
+ ### Search Angel (our search engine)
22
+ - Queries are NOT logged
23
+ - Your IP is hashed with a daily-rotating salt and discarded
24
+ - No cookies are set
25
+ - No behavioral profiling
26
+ - We use only privacy-respecting search engines (DuckDuckGo, Brave, Startpage, Mojeek)
27
+ - Google and Bing are disabled because they log queries
28
+
29
+ ### Tor Mode
30
+ - When Tor is enabled, all traffic routes through the Tor network
31
+ - Even our servers don't know who is making the request
32
+ - Your ISP only sees Tor traffic, not what sites you visit
33
+
34
+ ### Data Deletion
35
+ - By default, all browsing data is cleared when you close the browser
36
+ - You can clear history, bookmarks, and downloads at any time
37
+ - There is no server-side data to delete because we never collect any
package/README.md ADDED
@@ -0,0 +1,163 @@
1
+ <p align="center">
2
+ <img src="assets/logo.png" alt="Atlas Browser" width="200">
3
+ </p>
4
+
5
+ <h1 align="center">Atlas Browser</h1>
6
+
7
+ <p align="center">
8
+ <a href="https://github.com/intergalacticuser/atlas-browser/releases"><img src="https://img.shields.io/github/v/release/intergalacticuser/atlas-browser?style=flat-square&label=release&color=cyan" alt="Release"></a>
9
+ <img src="https://img.shields.io/badge/platform-macOS_Apple_Silicon-blue?style=flat-square" alt="macOS">
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"></a>
11
+ <img src="https://img.shields.io/badge/privacy-100%25-brightgreen?style=flat-square" alt="Privacy Score">
12
+ </p>
13
+
14
+ ---
15
+
16
+ ## Why I built this
17
+
18
+ I got tired of being the product.
19
+
20
+ Every browser I've used either tracks me, profiles me, or quietly sends data to some ad network pretending it's "anonymous telemetry." Even the privacy-focused ones still rely on Google for search results - the same Google that logs every query.
21
+
22
+ I wanted something different. Not a fork with a few toggles flipped. Something built from scratch with a simple rule: **your data is yours, period.**
23
+
24
+ So I built Atlas Browser. It's a real browser - videos play, web apps work, everything you expect. But underneath, it's fundamentally different:
25
+
26
+ - **Zero telemetry.** Not reduced telemetry. Zero.
27
+ - **No tracking cookies.** Not first-party. Not third-party. None.
28
+ - **Tracker blocker built in.** Not an extension you have to install.
29
+ - **Tor with one click.** Not a separate app. Not a hidden setting. A button.
30
+ - **A search engine that doesn't spy on you.** I built that too. It's called [Search Angel](https://github.com/intergalacticuser/search-angel).
31
+
32
+ This is a beta. It's not perfect. There are rough edges and missing features. But it works, it's fast, and it respects you.
33
+
34
+ If you've ever wished a browser like this existed - here it is. And if you want to help make it better, I'd genuinely love that.
35
+
36
+ *- Daniel*
37
+
38
+ ---
39
+
40
+ ## Features
41
+
42
+ | | What | Why it matters |
43
+ |---|------|---------------|
44
+ | :shield: | **Tracker Blocker** | Blocks 50+ ad/tracker domains. No extensions needed. |
45
+ | :onion: | **Tor Integration** | One button. All traffic through Tor. Your ISP sees nothing. |
46
+ | :ghost: | **Phantom Mode** | Spins up an isolated Docker container for your session. When done - container destroyed. Zero trace. |
47
+ | :mag: | **Search Angel** | Privacy search engine. Only uses DuckDuckGo, Brave, Startpage, Mojeek. Google/Bing disabled. |
48
+ | :world_map: | **Internet Map** | See the internet topology. Enter any domain, see where it lives. |
49
+ | :lock: | **Privacy Score** | Every site gets a 0-100 privacy rating in real time. |
50
+ | :bar_chart: | **Security Dashboard** | SSL status, cookies, trackers blocked, Tor circuit, all in one sidebar. |
51
+ | :bookmark: | **Bookmarks** | Bar + full manager. Local only. |
52
+ | :arrow_down: | **Downloads** | Built-in manager with progress tracking. |
53
+ | :broom: | **Auto-Clear** | Everything wiped on exit. By default. |
54
+ | :gear: | **Settings** | Homepage, privacy, Tor, appearance, downloads. |
55
+
56
+ ## Install
57
+
58
+ ### npx (fastest)
59
+
60
+ ```bash
61
+ npx atlas-browser
62
+ ```
63
+
64
+ ### curl
65
+
66
+ ```bash
67
+ curl -sL https://raw.githubusercontent.com/intergalacticuser/atlas-browser/main/install.sh | bash
68
+ ```
69
+
70
+ ### Download DMG
71
+
72
+ [Releases page](https://github.com/intergalacticuser/atlas-browser/releases)
73
+
74
+ ### Build from source
75
+
76
+ ```bash
77
+ git clone https://github.com/intergalacticuser/atlas-browser.git
78
+ cd atlas-browser
79
+ npm install
80
+ npm start
81
+ ```
82
+
83
+ Requires Node.js 20+, macOS 12+ (Apple Silicon)
84
+
85
+ ## How privacy works
86
+
87
+ I want to be completely transparent:
88
+
89
+ ```
90
+ Your device ──[HTTPS]──> Search Angel server ──> SearXNG (self-hosted)
91
+ ├── DuckDuckGo (no logging)
92
+ ├── Brave Search (no logging)
93
+ ├── Startpage (no logging)
94
+ └── Mojeek (no logging)
95
+ ```
96
+
97
+ - **Your query** exists in server RAM for a fraction of a second. Then it's gone. No database. No log file.
98
+ - **Your IP** gets one-way hashed with a daily rotating salt. The original is never stored.
99
+ - **Google and Bing are off.** They log everything. That's a dealbreaker.
100
+ - **SearXNG runs on our server.** Queries don't leave our infrastructure until they hit the privacy engines.
101
+ - **Tor mode:** even our server doesn't know who connected.
102
+ - **Phantom Mode:** your session runs in a Docker container that's destroyed when you're done.
103
+
104
+ ## Phantom Mode
105
+
106
+ The feature I'm most proud of.
107
+
108
+ Activate it and a fresh Docker container spins up just for you. All your searches happen inside it. When you end the session - or it auto-expires after 30 minutes - the container is permanently destroyed. Not stopped. Not archived. **Destroyed.**
109
+
110
+ Nothing survives. It's like the session never happened.
111
+
112
+ ## Search Angel
113
+
114
+ Atlas Browser's default search engine. Also open source:
115
+
116
+ **[github.com/intergalacticuser/search-angel](https://github.com/intergalacticuser/search-angel)**
117
+
118
+ Hybrid search (BM25 + vector embeddings + live web), evidence-based ranking, source credibility scoring. Built with FastAPI, PostgreSQL, OpenSearch, and SearXNG.
119
+
120
+ ## Roadmap
121
+
122
+ **Shipped:**
123
+ - [x] Multi-tab browser (Chromium engine)
124
+ - [x] Search Angel integration
125
+ - [x] Tracker/ad blocker
126
+ - [x] One-click Tor
127
+ - [x] Phantom Mode
128
+ - [x] Internet Map
129
+ - [x] Security dashboard
130
+ - [x] Bookmarks, downloads, history, settings
131
+ - [x] macOS .dmg
132
+
133
+ **Next:**
134
+ - [ ] Dynamic blocker lists (EasyList)
135
+ - [ ] Tab favicons
136
+ - [ ] Reader mode
137
+ - [ ] Real certificate parsing
138
+
139
+ **Later:**
140
+ - [ ] Windows & Linux
141
+ - [ ] Limited extension support
142
+ - [ ] Local-only password manager
143
+ - [ ] Encrypted sync
144
+
145
+ ## Contributing
146
+
147
+ This is beta. It needs work. If you care about privacy on the web, help me build it.
148
+
149
+ - **Found a bug?** [Open an issue](https://github.com/intergalacticuser/atlas-browser/issues)
150
+ - **Have an idea?** Start a discussion or submit a PR
151
+ - **Want to contribute code?** Fork, branch, PR. Standard flow.
152
+
153
+ No contribution is too small.
154
+
155
+ ## License
156
+
157
+ MIT - do whatever you want with it.
158
+
159
+ ---
160
+
161
+ <p align="center">
162
+ <sub>Built with stubbornness and a belief that the web should respect the people using it.</sub>
163
+ </p>
package/SECURITY.md ADDED
@@ -0,0 +1,29 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you discover a security vulnerability in Atlas Browser, **please report it responsibly**.
6
+
7
+ Email: intergalacticuser@users.noreply.github.com
8
+
9
+ Or open a [GitHub issue](https://github.com/intergalacticuser/atlas-browser/issues) with the `security` label.
10
+
11
+ I take security seriously - especially in a privacy-focused browser. I'll respond within 48 hours.
12
+
13
+ ## Supported Versions
14
+
15
+ | Version | Supported |
16
+ |---------|-----------|
17
+ | 0.2.x | Yes (current beta) |
18
+
19
+ ## Security Measures
20
+
21
+ Atlas Browser implements:
22
+ - Context isolation + sandboxed BrowserViews
23
+ - No node integration in renderer
24
+ - Secure preload bridge (contextBridge API)
25
+ - Built-in tracker/ad blocking
26
+ - Cookie auto-clear on exit
27
+ - User agent normalization
28
+ - Referrer stripping
29
+ - Tor integration for anonymous browsing
Binary file
package/bin/cli.js ADDED
@@ -0,0 +1,142 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Atlas Browser CLI
5
+ *
6
+ * Usage:
7
+ * npx atlas-browser # Download and launch
8
+ * npx atlas-browser install # Download and install to /Applications
9
+ * npx atlas-browser --help # Show help
10
+ */
11
+
12
+ const { execSync } = require('child_process');
13
+ const https = require('https');
14
+ const http = require('http');
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const os = require('os');
18
+
19
+ const REPO = 'intergalacticuser/atlas-browser';
20
+ const APP_NAME = 'Atlas Browser';
21
+
22
+ const CYAN = '\x1b[36m';
23
+ const GREEN = '\x1b[32m';
24
+ const DIM = '\x1b[2m';
25
+ const BOLD = '\x1b[1m';
26
+ const NC = '\x1b[0m';
27
+
28
+ function log(msg) { console.log(msg); }
29
+
30
+ async function main() {
31
+ const args = process.argv.slice(2);
32
+
33
+ if (args.includes('--help') || args.includes('-h')) {
34
+ log(`
35
+ ${CYAN}${BOLD}Atlas Browser${NC} - Privacy-First Web Browser
36
+
37
+ ${BOLD}Usage:${NC}
38
+ npx atlas-browser Download & launch
39
+ npx atlas-browser install Install to /Applications
40
+ npx atlas-browser --version Show version
41
+ npx atlas-browser --help Show this help
42
+
43
+ ${DIM}https://github.com/${REPO}${NC}
44
+ `);
45
+ return;
46
+ }
47
+
48
+ if (args.includes('--version') || args.includes('-v')) {
49
+ const pkg = require('../package.json');
50
+ log(`Atlas Browser v${pkg.version}`);
51
+ return;
52
+ }
53
+
54
+ if (os.platform() !== 'darwin') {
55
+ log(`${CYAN}Atlas Browser is currently macOS only.${NC}`);
56
+ log('Windows and Linux support coming soon.');
57
+ process.exit(1);
58
+ }
59
+
60
+ if (os.arch() !== 'arm64') {
61
+ log(`${CYAN}This release is for Apple Silicon (M1/M2/M3) only.${NC}`);
62
+ process.exit(1);
63
+ }
64
+
65
+ log('');
66
+ log(`${CYAN}${BOLD} Atlas Browser${NC}`);
67
+ log(`${DIM} Privacy-First Web Browser${NC}`);
68
+ log('');
69
+
70
+ // Check if already installed
71
+ const appPath = `/Applications/${APP_NAME}.app`;
72
+ if (fs.existsSync(appPath) && !args.includes('install')) {
73
+ log(`${GREEN} Already installed. Launching...${NC}`);
74
+ execSync(`open -a "${APP_NAME}"`);
75
+ return;
76
+ }
77
+
78
+ // Download latest release
79
+ log(`${DIM} Fetching latest release...${NC}`);
80
+
81
+ try {
82
+ const releaseUrl = await getLatestDmgUrl();
83
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'atlas-'));
84
+ const dmgPath = path.join(tmpDir, 'Atlas-Browser.dmg');
85
+
86
+ log(`${DIM} Downloading...${NC}`);
87
+ execSync(`curl -sL "${releaseUrl}" -o "${dmgPath}"`);
88
+
89
+ log(`${DIM} Installing...${NC}`);
90
+ const mountOutput = execSync(`hdiutil attach "${dmgPath}" -nobrowse -quiet`).toString();
91
+ const mountPoint = mountOutput.split('\n').filter(l => l.includes('/Volumes'))[0]?.split('\t').pop()?.trim();
92
+
93
+ if (mountPoint) {
94
+ const appSrc = fs.readdirSync(mountPoint).find(f => f.endsWith('.app'));
95
+ if (appSrc) {
96
+ if (fs.existsSync(appPath)) fs.rmSync(appPath, { recursive: true });
97
+ execSync(`cp -R "${path.join(mountPoint, appSrc)}" "/Applications/"`);
98
+ execSync(`xattr -rd com.apple.quarantine "${appPath}" 2>/dev/null || true`);
99
+ }
100
+ execSync(`hdiutil detach "${mountPoint}" -quiet 2>/dev/null || true`);
101
+ }
102
+
103
+ fs.rmSync(tmpDir, { recursive: true });
104
+
105
+ log('');
106
+ log(`${GREEN}${BOLD} ✓ Atlas Browser installed${NC}`);
107
+ log(`${DIM} Location: /Applications/${APP_NAME}.app${NC}`);
108
+ log('');
109
+
110
+ execSync(`open -a "${APP_NAME}"`);
111
+ log(`${GREEN} Launching...${NC}`);
112
+
113
+ } catch (err) {
114
+ log(`Error: ${err.message}`);
115
+ log(`Download manually: https://github.com/${REPO}/releases`);
116
+ process.exit(1);
117
+ }
118
+ }
119
+
120
+ function getLatestDmgUrl() {
121
+ return new Promise((resolve, reject) => {
122
+ https.get(`https://api.github.com/repos/${REPO}/releases/latest`, {
123
+ headers: { 'User-Agent': 'atlas-browser-cli' }
124
+ }, (res) => {
125
+ let data = '';
126
+ res.on('data', chunk => data += chunk);
127
+ res.on('end', () => {
128
+ try {
129
+ const release = JSON.parse(data);
130
+ const asset = release.assets?.find(a => a.name.endsWith('.dmg'));
131
+ if (asset) resolve(asset.browser_download_url);
132
+ else reject(new Error('No DMG found in latest release'));
133
+ } catch { reject(new Error('Failed to parse release info')); }
134
+ });
135
+ }).on('error', reject);
136
+ });
137
+ }
138
+
139
+ main().catch(err => {
140
+ console.error(err);
141
+ process.exit(1);
142
+ });
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Blocker = void 0;
4
+ // Common tracker/ad domains to block
5
+ const BLOCKED_DOMAINS = new Set([
6
+ // Ad networks
7
+ 'doubleclick.net', 'googlesyndication.com', 'googleadservices.com',
8
+ 'google-analytics.com', 'googletagmanager.com', 'googletagservices.com',
9
+ 'adservice.google.com', 'pagead2.googlesyndication.com',
10
+ 'ads.facebook.com', 'pixel.facebook.com', 'connect.facebook.net',
11
+ 'ad.doubleclick.net', 'adnxs.com', 'adsrvr.org',
12
+ 'amazon-adsystem.com', 'ads-twitter.com',
13
+ 'advertising.com', 'criteo.com', 'criteo.net',
14
+ 'outbrain.com', 'taboola.com', 'revcontent.com',
15
+ // Trackers
16
+ 'hotjar.com', 'fullstory.com', 'mouseflow.com',
17
+ 'mixpanel.com', 'amplitude.com', 'segment.com', 'segment.io',
18
+ 'optimizely.com', 'crazyegg.com', 'clicktale.net',
19
+ 'newrelic.com', 'nr-data.net', 'pingdom.net',
20
+ 'quantserve.com', 'scorecardresearch.com', 'imrworldwide.com',
21
+ 'comscore.com', 'chartbeat.com', 'parsely.com',
22
+ // Social trackers
23
+ 'platform.twitter.com', 'syndication.twitter.com',
24
+ 'platform.linkedin.com', 'snap.licdn.com',
25
+ 'static.ads-twitter.com',
26
+ // Fingerprinting
27
+ 'fingerprintjs.com', 'cdn.jsdelivr.net/npm/@aspect',
28
+ // Misc trackers
29
+ 'tracking.', 'analytics.', 'telemetry.',
30
+ 'sentry.io', 'bugsnag.com',
31
+ ]);
32
+ // URL patterns to block
33
+ const BLOCKED_PATTERNS = [
34
+ /\/ads\//i,
35
+ /\/tracking\//i,
36
+ /\/analytics\//i,
37
+ /\/pixel\//i,
38
+ /google-analytics/i,
39
+ /facebook.*pixel/i,
40
+ /doubleclick/i,
41
+ /\.gif\?.*utm_/i,
42
+ /__utm\.gif/i,
43
+ /beacon\./i,
44
+ ];
45
+ class Blocker {
46
+ callbacks = new Map();
47
+ totalBlocked = 0;
48
+ isEnabled = true;
49
+ setup(session) {
50
+ session.webRequest.onBeforeRequest((details, callback) => {
51
+ if (!this.isEnabled) {
52
+ callback({});
53
+ return;
54
+ }
55
+ const shouldBlock = this.shouldBlock(details.url);
56
+ if (shouldBlock) {
57
+ this.totalBlocked++;
58
+ // Notify tab-specific callbacks
59
+ const tabCallbacks = details.webContentsId != null ? this.callbacks.get(details.webContentsId) : undefined;
60
+ if (tabCallbacks) {
61
+ tabCallbacks.forEach(cb => cb());
62
+ }
63
+ callback({ cancel: true });
64
+ }
65
+ else {
66
+ callback({});
67
+ }
68
+ });
69
+ }
70
+ shouldBlock(url) {
71
+ try {
72
+ const parsed = new URL(url);
73
+ const hostname = parsed.hostname;
74
+ // Check against blocked domains
75
+ for (const domain of BLOCKED_DOMAINS) {
76
+ if (hostname === domain || hostname.endsWith('.' + domain)) {
77
+ return true;
78
+ }
79
+ }
80
+ // Check URL patterns
81
+ for (const pattern of BLOCKED_PATTERNS) {
82
+ if (pattern.test(url)) {
83
+ return true;
84
+ }
85
+ }
86
+ return false;
87
+ }
88
+ catch {
89
+ return false;
90
+ }
91
+ }
92
+ onBlocked(webContentsId, callback) {
93
+ const existing = this.callbacks.get(webContentsId) || [];
94
+ existing.push(callback);
95
+ this.callbacks.set(webContentsId, existing);
96
+ }
97
+ toggle() {
98
+ this.isEnabled = !this.isEnabled;
99
+ return this.isEnabled;
100
+ }
101
+ get enabled() {
102
+ return this.isEnabled;
103
+ }
104
+ get blockedTotal() {
105
+ return this.totalBlocked;
106
+ }
107
+ }
108
+ exports.Blocker = Blocker;
109
+ //# sourceMappingURL=blocker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocker.js","sourceRoot":"","sources":["../../src/main/blocker.ts"],"names":[],"mappings":";;;AAEA,qCAAqC;AACrC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,cAAc;IACd,iBAAiB,EAAE,uBAAuB,EAAE,sBAAsB;IAClE,sBAAsB,EAAE,sBAAsB,EAAE,uBAAuB;IACvE,sBAAsB,EAAE,+BAA+B;IACv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