# dev-coco/semi-automatic-block architecture

> Architecture diagram of the GitHub repository dev-coco/semi-automatic-block, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dev-coco/semi-automatic-block
- Repository: https://github.com/dev-coco/semi-automatic-block

## Overview

##### Project type and purpose
- This is a browser‐extension project (Chrome/Firefox) named “Semi-Automatic-Block.”
- Purpose: inject a small script into Facebook pages to semi-automatically block user accounts via Facebook’s mobile block URL.

##### File structure
- Root files only; no “src” or “backend” directory:
- manifest.json – defines the extension (permissions, content scripts, matches).
- inject.js – the content script that runs on matching pages.
- README.md – project description and block URL template.
- LICENSE – license text.
- No background script or UI HTML is present—this is a single‐content‐script extension.

##### README for additional insights
- Confirms that the tool uses the mobile “block” endpoint:
https://m.facebook.com/privacy/touch/block/confirm/?…&bid={user_id}
- No other APIs or external services are involved beyond Facebook.

##### Elements
1. Browser → load extension
2. Manifest → inject script into Facebook pages
3. inject.js ↔ Facebook Page DOM
4. inject.js → Facebook Block Endpoint (HTTP POST/GET)

##### Detailed guidance
- Facebook server outside the browser boundary to highlight the external call.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Browser Host"
        Browser["Browser (Chrome/Firefox)"]:::browser
        Manifest["Extension Container\nmanifest.json\n- content_scripts.matches\n- js\n- permissions"]:::extension
        README["Project Documentation\nREADME.md"]:::extension
        LICENSE["License File\nLICENSE"]:::extension
        Inject["Content Script\ninject.js\n- extract user_id\n- call block URL"]:::script
    end

    FBPage["Facebook Mobile Page\n(DOM)"]:::external
    FBServer["Facebook Block Endpoint\nm.facebook.com/privacy/touch/block/..."]:::external

    Browser -->|"loads extension"| Manifest
    Manifest -->|"match & inject"| Inject
    Inject -->|"reads DOM & extracts user_id"| FBPage
    Inject -->|"fetch block URL"| FBServer

    click Manifest "https://github.com/dev-coco/semi-automatic-block/blob/main/./manifest.json"
    click Inject "https://github.com/dev-coco/semi-automatic-block/blob/main/./inject.js"
    click README "https://github.com/dev-coco/semi-automatic-block/blob/main/./README.md"
    click LICENSE "https://github.com/dev-coco/semi-automatic-block/tree/main/./LICENSE"

    classDef browser fill:#bbdefb,stroke:#0d47a1,stroke-width:1px
    classDef extension fill:#c8e6c9,stroke:#1b5e20,stroke-width:1px
    classDef script fill:#fff9c4,stroke:#f57f17,stroke-width:1px
    classDef external fill:#ffcdd2,stroke:#b71c1c,stroke-width:1px
```
