https://github.com/shugur-network/nw-extention
Browser extension for accessing decentralized websites on Nostr - Chrome & Firefox support
https://github.com/shugur-network/nw-extention
browser-extension censorship-resistant chrome decentralized-web firefox nostr nostr-protocol web3
Last synced: 8 months ago
JSON representation
Browser extension for accessing decentralized websites on Nostr - Chrome & Firefox support
- Host: GitHub
- URL: https://github.com/shugur-network/nw-extention
- Owner: Shugur-Network
- License: mit
- Created: 2025-10-15T09:29:45.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-30T20:24:17.000Z (8 months ago)
- Last Synced: 2025-10-30T22:22:15.768Z (8 months ago)
- Topics: browser-extension, censorship-resistant, chrome, decentralized-web, firefox, nostr, nostr-protocol, web3
- Language: JavaScript
- Homepage: https://nweb.shugur.com/
- Size: 415 KB
- Stars: 12
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nostr Web Extension
Browse decentralized websites on Nostr - A censorship-resistant, verifiable, permanent web.
[](https://chromewebstore.google.com/detail/nostr-web-browser/hhdngjdmlabdachflbdfapkogadodkif)
[](https://addons.mozilla.org/en-US/firefox/addon/nostr-web-browser/)
[](https://chromewebstore.google.com/detail/nostr-web-browser/hhdngjdmlabdachflbdfapkogadodkif)
[](https://addons.mozilla.org/en-US/firefox/addon/nostr-web-browser/)
[](LICENSE)
## 🚀 Quick Start
### Usage
1. **Automatic Detection:** Just type any domain in your browser (e.g., `nweb.shugur.com`)
2. **Manual Entry:** Click extension icon → Enter domain → Press Enter
3. **Browse:** Navigate links, use back/forward, and enjoy decentralized web!
## Security
The extension implements multiple security layers:
1. **Author Pinning** - DNS TXT record pins site publisher's public key
2. **Subresource Integrity** - SHA256 verification for JavaScript
3. **Sandboxed Rendering** - Isolated execution environment
4. **Rate Limiting** - Protection against DoS attacks
## 🏗️ How It Works
```
User types domain → DNS lookup → Fetch from Nostr relays → Verify integrity → Render in sandbox
```
1. Check DNS TXT record at `_nweb.` for publisher pubkey and relay list
2. Query relays for entrypoint (kind 11126) pointing to site index
3. Fetch site index (kind 31126) listing all page manifests
4. Fetch page manifest (kind 1126) for current route
5. Fetch all assets (kind 1125) - HTML, CSS, JS, images, etc.
6. Verify author signatures and JavaScript integrity (SRI)
7. Assemble HTML and render in sandboxed iframe
## 🚀 Performance
- **First-EOSE Strategy** - Returns after fastest relay (200-500ms typical)
- **Connection Pooling** - Persistent WebSocket connections
- **Smart Caching** - 7-day asset cache, 30-second manifest cache
- **Event Deduplication** - Filters duplicates from multiple relays
- **Parallel Fetching** - Queries all relays simultaneously
## 🛠️ Development
```bash
# Setup
git clone https://github.com/Shugur-Network/nw-extention.git
cd nw-extention
npm install
# Build
npm run build # Build both browsers
npm run build:chrome # Chrome only
npm run build:firefox # Firefox only
# Test
npm test # Run test suite
npm run validate # Validate structure
# Output: dist/chrome/ and dist/firefox/
```
## 📋 Project Structure
```
nw-extention/
├── src/
│ ├── chrome/ # Chrome-specific (service worker + offscreen)
│ ├── firefox/ # Firefox-specific (background script)
│ ├── shared/ # Shared modules (logger, constants, errors)
│ └── ui/ # UI components (popup, viewer, settings, sandbox)
├── test/ # Test suite
├── scripts/ # Build scripts
└── public/ # Static assets
```
## 🤝 Contributing
Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Add tests for new code
4. Submit a Pull Request
## 📄 License
MIT License - See [LICENSE](LICENSE) file for details
## 🔗 Links
- **Website:** https://nweb.shugur.com
- **GitHub:** https://github.com/Shugur-Network/nw-extention
- **Issues:** https://github.com/Shugur-Network/nw-extention/issues
- **Publisher Tool:** [nw-publisher on npm](https://www.npmjs.com/package/nw-publisher)
- **Chrome Store:** https://chromewebstore.google.com/detail/nostr-web-browser/hhdngjdmlabdachflbdfapkogadodkif
- **Firefox Add-ons:** https://addons.mozilla.org/en-US/firefox/addon/nostr-web-browser/
## 💬 Support
- **Issues:** [GitHub Issues](https://github.com/Shugur-Network/nw-extention/issues)
- **Email:** support@shugur.com