Skip to content

WileyWong/postboy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postboy

A lightweight Chrome extension for API requests with automatic cookie injection — no more copying scripts to the Console.

Why Postboy?
Tired of editing var url = "..." and var params = {...} in the Console every time you need to call an internal API with authentication?
Postboy handles the boring parts — just fill in the URL, params, and send.

Why not just use an existing tool? Writing it ourselves gives us peace of mind, and the functionality is simple. This tool isn't meant to compete with Postman — it's just for our own convenience.


Features

  • Auto Cookie Injection — Automatically grabs cookies from your current tab and injects them into the request. No manual cookie handling.
  • Collections — Organize your APIs into named groups. Supports CRUD, drag-and-drop reorder, cross-collection move.
  • History — Every request is automatically saved. Click any entry to restore both the request fields and the response result.
  • Response Viewer — Status code (color-coded), duration, response headers (collapsible), and formatted JSON body.
  • Persistent Storage — All data survives browser restarts (chrome.storage.local).
  • Session Draft — Popup accidentally closed? Your current edit is auto-saved and restored.
  • Resizable Window — Drag the window edges to resize freely.

Install

1. Load as Unpacked Extension

  1. Open Chrome and go to chrome://extensions/
  2. Enable Developer mode (toggle top-right)
  3. Click Load unpacked
  4. Select the chrome-post-api folder

2. Pin to Toolbar

Click the puzzle icon in the toolbar, find "Postboy", and click the pin icon.


Quick Start

  1. Log in to your internal system in a Chrome tab (keep this tab open)
  2. Click the Postboy icon in the toolbar
  3. Enter the API URL (e.g. http://internal-api.example.com/endpoint)
  4. Select the HTTP method
  5. Edit Headers and Body as needed
  6. Click Send (or press Ctrl+Enter)

The Cookie from your current active tab will be automatically injected into the request.


Screenshots

Area Description
Left Panel Collections (tree view with drag & drop) / History (time-ordered list)
Request Area URL input + Method selector + Headers table + Body editor + Send/Save buttons
Response Area Status badge (color-coded) + Duration + Collapsible response headers + Formatted body

Keyboard Shortcuts

Shortcut Action
Ctrl+Enter / Cmd+Enter Send request
Ctrl+S / Cmd+S Save to collection
Double-click item name Rename

Tech Stack

  • Manifest V3 — Latest Chrome extension standard
  • Preact + HTM — ~4KB gzip, zero-build component framework
  • Pure CSS — Dark theme, no UI framework dependency

Project Structure

chrome-post-api/
├── manifest.json              # Extension config
├── icons/                     # Extension icons
├── popup/
│   ├── popup.html / .css      # Entry HTML and styles
│   ├── app.js                 # ESM entry
│   ├── components/            # 8 Preact components
│   ├── hooks/                 # 4 custom hooks
│   ├── utils/                 # Helpers (date, validators)
│   └── vendor/                # Preact + HTM (~17KB)
├── background/
│   ├── service-worker.js      # Window manager + message routing
│   └── message-handler.js     # Request handler + cookie injection
└── shared/
    ├── constants.js            # App constants
    ├── storage.js              # chrome.storage wrapper
    ├── models.js               # Data model factories
    ├── cookie-manager.js       # Cookie utilities
    └── uuid.js                 # UUID generation

Development

No build tools required. All files are plain JS/CSS/HTML that Chrome loads directly.

Hot Reload

After modifying files, just click the refresh icon on the extension card in chrome://extensions/.


License

MIT

About

chrome插件实现简单的API调用,复用chrome的cookie

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages