{"id":50609468,"url":"https://github.com/dudeaint/brownbear","last_synced_at":"2026-06-10T11:00:27.517Z","repository":{"id":362800933,"uuid":"1260855223","full_name":"DudeAint/brownbear","owner":"DudeAint","description":"The first iOS browser to bring ScriptCat-class power to userscripts: background execution, @crontab scheduling, and a sandboxed GM API, in a Chromium-style UI.","archived":false,"fork":false,"pushed_at":"2026-06-08T05:01:26.000Z","size":1163,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T05:23:03.325Z","etag":null,"topics":["background-tasks","browser","crontab","gm-api","greasemonkey","ios","ios-browser","scriptcat","swift","swiftui","tampermonkey","userscripts","webkit","wkwebview"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DudeAint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-06T00:26:36.000Z","updated_at":"2026-06-08T04:59:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/DudeAint/brownbear","commit_stats":null,"previous_names":["dudeaint/brownbear"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DudeAint/brownbear","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DudeAint%2Fbrownbear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DudeAint%2Fbrownbear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DudeAint%2Fbrownbear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DudeAint%2Fbrownbear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DudeAint","download_url":"https://codeload.github.com/DudeAint/brownbear/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DudeAint%2Fbrownbear/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34149132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-tasks","browser","crontab","gm-api","greasemonkey","ios","ios-browser","scriptcat","swift","swiftui","tampermonkey","userscripts","webkit","wkwebview"],"created_at":"2026-06-06T02:02:59.126Z","updated_at":"2026-06-10T11:00:27.512Z","avatar_url":"https://github.com/DudeAint.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/DudeAint/brownbear/main/docs/assets/banner.png\" alt=\"BrownBear — Userscripts \u0026 Power Browser for iOS\" width=\"100%\" /\u003e\n\n\u003cbr/\u003e\n\n**The first iOS browser to bring ScriptCat-class power to userscripts — background execution, `@crontab` scheduling, and a sandboxed GM API — _and_ run real Chrome Web Store extensions, all wrapped in a Chromium-inspired interface.**\n\n\u003cbr/\u003e\n\n[![Platform](https://img.shields.io/badge/platform-iOS%2016.4%2B-0A84FF?style=for-the-badge\u0026logo=apple\u0026logoColor=white)](https://developer.apple.com/ios/)\n[![Swift](https://img.shields.io/badge/Swift-5.8%2B-F05138?style=for-the-badge\u0026logo=swift\u0026logoColor=white)](https://swift.org)\n[![WebKit](https://img.shields.io/badge/WebKit-WKWebView-1589F0?style=for-the-badge\u0026logo=safari\u0026logoColor=white)](https://developer.apple.com/documentation/webkit)\n[![License](https://img.shields.io/badge/License-MIT-3DA639?style=for-the-badge\u0026logo=opensourceinitiative\u0026logoColor=white)](LICENSE)\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-FE5196?style=flat-square\u0026logo=conventionalcommits\u0026logoColor=white)](https://www.conventionalcommits.org)\n[![Code Style: SwiftLint](https://img.shields.io/badge/code%20style-SwiftLint-43B02A?style=flat-square)](.swiftlint.yml)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](CONTRIBUTING.md)\n[![Status](https://img.shields.io/badge/status-pre--alpha-yellow?style=flat-square)](#-project-status)\n\n\u003cbr/\u003e\n\n[**Features**](#-features) · [**Why BrownBear**](#-why-brownbear) · [**How It Compares**](#-how-it-compares) · [**Architecture**](#-architecture) · [**Contributing**](#-contributing)\n\n\u003c/div\u003e\n\n---\n\n## 🐻 Why BrownBear\n\niOS has never had a true *power* userscript runtime. Safari extensions like\n[**Userscripts**](https://github.com/quoid/userscripts) and [**Stay**](https://apps.apple.com/app/stay-for-safari/id1591620171)\nbrought Greasemonkey-style injection to mobile, and [**Gear Browser**](https://gear4.app/) proved a\ndedicated userscript browser can ship on the App Store. But none of them deliver the one thing\n[**ScriptCat**](https://github.com/scriptscat/scriptcat) gives desktop users:\n\n\u003e **Scripts that keep working in the background — on a schedule — without a tab open.**\n\nBrownBear is that missing piece. A standalone browser that pairs a clean, Chromium-style\ninterface with a sandboxed engine that runs `@background` userscripts driven by `@crontab`,\nall within the constraints Apple's WebKit and background-execution model allow — honestly and\ntransparently, with every scheduled job visible and stoppable.\n\n---\n\n## ✨ Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 🌐 Chromium-style Browser\n- Multi-tab architecture on `WKWebView`\n- **Square tab grid** with live snapshots\n- Custom **rounded omnibox** — URL/search detection, TLS indicator\n- Full back / forward / refresh / stop\n- Precise lifecycle via `WKNavigationDelegate`\n\n\u003c/td\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 📜 Userscript Engine\n- Tampermonkey / Greasemonkey / Violentmonkey-compatible headers\n- `@name` · `@match` · `@include` · `@exclude` · `@run-at` · `@grant` · `@connect` · `@crontab`\n- Glob → regex URL matcher (WebKit-tuned)\n- Inject at **document-start / end / idle**\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 🧪 Sandbox \u0026 GM API\n- Hostile-page-resistant runtime (clean refs captured at injection)\n- `GM_xmlhttpRequest` via native `URLSession` (**CORS-free**, `@connect`-gated)\n- `GM_setValue` / `getValue` — per-script namespaced store\n- `GM_addStyle`, `GM_setClipboard`, `GM_openInTab`, `GM_log`\n\n\u003c/td\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### ⏰ Background \u0026 @crontab\n- `BGTaskScheduler` (app-refresh + processing)\n- Persisted schedule store (Core Data)\n- 5-field crontab evaluator + `@every`\n- Headless `JSContext` runs scripts **while the app is closed**\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"2\" valign=\"top\"\u003e\n\n### 📊 Manager Dashboard \u0026 Editor\nA polished SwiftUI dashboard to install, toggle, and inspect scripts · live execution logs ·\nbackground-task monitor · an in-app code editor with **line numbers, JS syntax highlighting,\nand save-time metadata validation**.\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"2\" valign=\"top\"\u003e\n\n### 🧩 Chrome Web Store Extensions\nInstall and run **real browser extensions** (MV2 **and** MV3) from the Chrome Web Store, Edge\nAdd-ons, or Firefox AMO — paste a link or install a `.crx`/`.zip`. A broad native-backed\n`chrome.*` / `browser.*` surface: **service workers** (classic *and* ES-module, e.g. uBlock Origin\nLite) in a headless `JSContext`, **content scripts**, **popup/options pages** over a\n`chrome-extension://` scheme, `storage` · `tabs` · `windows` · `webNavigation` · `scripting` ·\n`cookies` · `notifications` · `contextMenus` · `identity` · `alarms` · `i18n` · `runtime`\nmessaging + long-lived ports, **`declarativeNetRequest`** ad-blocking via `WKContentRuleList`,\na polyfilled **IndexedDB**, and web platform APIs JavaScriptCore lacks (`fetch`/`Headers`/`Request`/\n`Response`/`AbortController`/`FormData`/`Blob`/`File`/`XMLHttpRequest`/Web Crypto/`structuredClone`).\nUserscript-manager extensions (e.g. **ScriptCat**) are first-class — a `.user.js` link can be\nhanded off to them. Constrained, partial, and unsupported APIs are [documented honestly](docs/WEB_EXTENSIONS.md).\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 🆚 How It Compares\n\n| Capability | **🐻 BrownBear** | Gear Browser | Userscripts (Safari) | Stay (Safari) | ScriptCat (desktop) |\n|---|:---:|:---:|:---:|:---:|:---:|\n| Standalone iOS browser | ✅ | ✅ | ❌ (extension) | ❌ (extension) | ❌ (desktop) |\n| Tampermonkey-style metadata | ✅ | ✅ | ✅ | ✅ | ✅ |\n| `GM_xmlhttpRequest` (CORS-free) | ✅ | ✅ | ✅ | ✅ | ✅ |\n| Per-script value store | ✅ | ✅ | ✅ | ✅ | ✅ |\n| **Background scripts (no tab)** | ✅ | ⚠️ limited | ❌ | ❌ | ✅ |\n| **`@crontab` scheduling** | ✅ | ❌ | ❌ | ❌ | ✅ |\n| Built-in code editor | ✅ | ✅ | ✅ | ✅ | ✅ |\n| **Chrome Web Store extensions** | ✅ MV2/MV3 | ✅ | ❌ | ❌ | ❌ |\n| Open source | ✅ MIT | ❌ | ✅ GPL | ✅ | ✅ GPL |\n\n\u003e ⚠️ iOS background execution is **budgeted and best-effort** by design — `@crontab` is a\n\u003e *target* schedule, not a hard real-time guarantee. BrownBear surfaces this honestly in the UI.\n\n---\n\n## 🧱 Architecture\n\nBrownBear is one app composed of four runtime planes — a foreground browser, a pure-logic\nengine, a security bridge, and a background scheduler:\n\n```\n            ┌────────────────────────── Foreground ──────────────────────────┐\n user ──▶ Omnibox ──▶ BrowserVC ──▶ WKWebView(tab) ──▶ injected runtime ──┐   │\n            ▲              │                                               │   │\n         TabGrid ◀─────────┘                                          GM calls │\n            └─────────────────────── Bridge (WKScriptMessageHandler) ─────┘   │\n                                            │                                  │\n   Engine: ScriptMetadata · URLMatcher · InjectionPlanner  ◀── decides injection\n                                            │                                  │\n   Native GM services: Network(URLSession) · GMValueStore · Clipboard · Tabs   │\n                                            │                                  │\n            ┌──────────────────────── Background ─────────────────────────────┘\n            BGTaskScheduler ──▶ CrontabEvaluator ──▶ headless JSContext ──▶ Logs\n                                            │\n   Storage: Core Data (Script, Schedule, LogEntry) + UserDefaults (GM values, namespaced)\n```\n\n📐 Full technical blueprint: [**ARCHITECTURE.md**](ARCHITECTURE.md)\n\n---\n\n## 🚀 Project Status\n\n🚧 **Pre-alpha — actively being built.** All six modules have landed — the Chromium-style browser,\nthe userscript engine + sandbox, the `@crontab` background runner, the dashboard/editor, and the\nChrome Web Store extension runtime (Module 6) — and the focus now is real-world hardening against\nshipping extensions (ScriptCat, uBlock Origin Lite, Violentmonkey, Grammarly, …). The engineering\nbar is App-Store-shippable code: no stubs, no mocks, no truncation (see [`CLAUDE.md`](CLAUDE.md) and\n[`AGENTS.md`](AGENTS.md)). Where WebKit's extension-less model forces a limit, we degrade honestly\nand [document it](docs/WEB_EXTENSIONS.md).\n\n---\n\n## 🛠️ Getting Started\n\n**Requirements:** Xcode 15+ · iOS/iPadOS 16.4+ deployment target · an Apple Developer account\nfor on-device background-task testing.\n\n**Recommended: let GitHub Actions build it.** CI on free macOS runners is the canonical build\npath — open a PR and it's built + tested automatically. To build locally, the Xcode project is\ngenerated from [`project.yml`](project.yml) with [XcodeGen](https://github.com/yonsm/XcodeGen):\n\n```bash\ngit clone https://github.com/DudeAint/brownbear.git\ncd brownbear\nbrew install xcodegen          # one-time\nxcodegen generate              # creates BrownBear.xcodeproj from project.yml\nopen BrownBear.xcodeproj\n```\n\nFull instructions (CI, local, tests, lint): [`docs/BUILDING.md`](docs/BUILDING.md).\n\n\u003e Reference repositories are documented in [`References/REFERENCES.md`](References/REFERENCES.md).\n\u003e We study their architecture; we never vendor their (GPL/AGPL) source.\n\n---\n\n## 🤝 Contributing\n\nWe use [Conventional Commits](https://www.conventionalcommits.org), feature branches, and\ngreen-`main` discipline. **AI agents working in this repo must follow [`CLAUDE.md`](CLAUDE.md)\nand [`AGENTS.md`](AGENTS.md).** Start with [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\n## 🔒 Security\n\nThis app executes untrusted JavaScript. Found a vulnerability? Follow the responsible-disclosure\nprocess in [`SECURITY.md`](SECURITY.md) — please don't open a public issue.\n\n---\n\n## 💛 Contributors\n\nEvery PR, script, and bug report makes BrownBear better. Thank you.\n\n\u003ca href=\"https://github.com/DudeAint/brownbear/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=DudeAint/brownbear\" alt=\"BrownBear contributors\" /\u003e\n\u003c/a\u003e\n\n\u003csub\u003eAvatar wall auto-generated by \u003ca href=\"https://contrib.rocks\"\u003econtrib.rocks\u003c/a\u003e — new contributors appear here after their first merged PR.\u003c/sub\u003e\n\n## ⭐ Star History\n\nIf BrownBear is useful to you, a star helps others find it.\n\n\u003ca href=\"https://star-history.com/#DudeAint/brownbear\u0026Date\"\u003e\n  \u003cimg src=\"https://api.star-history.com/svg?repos=DudeAint/brownbear\u0026type=Date\" alt=\"Star History Chart\" width=\"600\" /\u003e\n\u003c/a\u003e\n\n---\n\n## 📄 License\n\n[MIT](LICENSE) © BrownBear contributors. BrownBear is an independent implementation; it learns\narchitectural patterns from the projects in [`References/REFERENCES.md`](References/REFERENCES.md)\nbut contains no copied source from GPL/AGPL-licensed projects.\n\n## 🙏 Acknowledgements\n\nInspired by [ScriptCat](https://github.com/scriptscat/scriptcat) ·\n[Userscripts](https://github.com/quoid/userscripts) · [Stay](https://github.com/mapleDistant/Stay) ·\n[Gear Browser](https://gear4.app/) · and the iOS layer of [Chromium](https://github.com/chromium/chromium).\n\n\u003cdiv align=\"center\"\u003e\u003cbr/\u003e\u003csub\u003eBuilt with 🐻 and an intolerance for stubbed code.\u003c/sub\u003e\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdudeaint%2Fbrownbear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdudeaint%2Fbrownbear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdudeaint%2Fbrownbear/lists"}