Extension Development Guide

This guide covers how to develop extensions for Macro Browser, focusing on privacy-respecting design and Macro-specific features.

Extension Architecture Overview


Macro Browser supports two types of extensions:

  1. Standard Extensions - Compatible with Chromium extensions, with some privacy-focused limitations

  2. Privacy Extensions - Enhanced extension type with access to Macro-specific privacy APIs

Diagram 1

Getting Started


Setting Up Your Development Environment

Directory Structure

A typical Macro Browser extension has the following structure:

Manifest File

Privacy Manifest (privacy.json)

Building Standard Extensions


Background Scripts

Background scripts run in the extension's background context.

Content Scripts

Content scripts run in the context of web pages.

Privacy-Focused Extension Features


Accessing Macro-Specific Privacy APIs

Privacy-Respecting Storage Strategy

Respecting DNT and Privacy Signals

Secure Communication

Web3 Integration for Extensions


Testing and Debugging Extensions


Testing in Macro Browser

Unit Testing Extension Components

End-to-End Testing

Publishing Your Extension


Privacy Review Checklist

Before submitting your extension for review, ensure it follows these privacy principles:

  • [ ] Collects only necessary data (or no data at all)

  • [ ] All data collection is clearly documented in privacy.json

  • [ ] Does not track users across websites

  • [ ] Provides clear privacy controls in the UI

  • [ ] Follows the principle of least privilege for permissions

  • [ ] Network requests are limited to documented endpoints

  • [ ] No third-party tracking or analytics

  • [ ] Code is readable and well-documented

  • [ ] Securely handles any sensitive data

  • [ ] Respects all browser privacy settings

Submission Process

  1. Package your extension:

  2. Complete the privacy declaration in privacy.json

  3. Submit to the Macro Extension Store with:

    • Detailed description

    • Screenshots and demo video

    • Complete privacy information

    • Support contact information

  4. Respond to any privacy review feedback

  5. After approval, your extension will be published to the Macro Extension Store

Best Practices for Privacy-Focused Extensions


  1. Minimize Data Collection: Collect only what's absolutely necessary for functionality

  2. Process Locally: Keep data processing within the browser whenever possible

  3. Use Memory-Only Storage: For sensitive information, avoid persistent storage

  4. Respect Privacy Signals: Honor DNT, GPC, and Macro-specific privacy signals

  5. Provide Clear Controls: Give users easy access to privacy settings

  6. Secure Communications: Use only HTTPS and secure communication methods

  7. Fallback Gracefully: Support non-Macro browsers with appropriate fallbacks

  8. Document Privacy Practices: Be transparent about all privacy-related functionality

  9. Regular Security Updates: Maintain and update your extension regularly

  10. Follow Least Privilege: Request only the permissions you absolutely need

Resources


Last updated