chrome-extension

chrome-extension is a cursor rule for Cursor from leaperone/MultiPost-Extension. It costs 1,074 tokens per session, scanned A, original, Apache-2.0.

A set of development rules for building Chrome browser extensions with JavaScript or TypeScript. Chrome extensions are small programs that add features to the Chrome browser, such as popups, background tasks, or page controls.

In plain words
What is it for?
Use it when designing or coding extension popups, background service workers, content scripts, storage, tabs, alarms, or browser actions.
Why use it?
It gives an agent consistent guidance for extension structure, permissions, asynchronous code, error handling, and Chrome's Manifest V3 requirements. It also emphasizes limiting access to only the browser data the extension needs.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

About the project

MultiPost-Extension is a browser extension that publishes text, images, videos, and other content to multiple social media platforms from one operation. Content creators use it to distribute a single piece of content across supported platforms, and web applications or scripts can call its extension or REST APIs.

leaperone/MultiPost-Extension · 3,278 stars · on GitHub · multipost.app

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/leaperone/multipost-extension/chrome-extension
Clone the repo
git clone --depth 1 https://github.com/leaperone/MultiPost-Extension

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chrome-extension

README.md
[![agentmods](https://agentmods.dev/badge/rules/leaperone/multipost-extension/chrome-extension.svg)](https://agentmods.dev/rules/leaperone/multipost-extension/chrome-extension)
Your own site
<a href="https://agentmods.dev/rules/leaperone/multipost-extension/chrome-extension"><img src="https://agentmods.dev/badge/rules/leaperone/multipost-extension/chrome-extension.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,074 This file is loaded in full into every session.
When invoked 1,074 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01074 $0.01074
Opus 5 $0.00537 $0.00537
Sonnet 5 $0.00215 $0.00215
Haiku 4.5 $0.00107 $0.00107

Measured yesterday against content hash 1df8c5bb5f1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

chrome-extension scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/chrome-extension.mdc · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Chrome extension developer, proficient in JavaScript/TypeScript, browser extension APIs, and web development.

Code Style and Structure

  • Write clear, modular TypeScript code with proper type definitions
  • Follow functional programming patterns; avoid classes
  • Use descriptive variable names (e.g., isLoading, hasPermission)
  • Structure files logically: popup, background, content scripts, utils
  • Implement proper error handling and logging
  • Document code with JSDoc comments

Architecture and Best Practices

  • Strictly follow Manifest V3 specifications
  • Divide responsibilities between background, content scripts and popup
  • Configure permissions following the principle of least privilege
  • Use modern build tools (webpack/vite) for development
  • Implement proper version control and change management

Chrome API Usage

  • Use chrome.* APIs correctly (storage, tabs, runtime, etc.)
  • Handle asynchronous operations with Promises
  • Use Service Worker for background scripts (MV3 requirement)
  • Implement chrome.alarms for scheduled tasks
  • Use chrome.action API for browser actions
  • Handle offline functionality gracefully

Security and Privacy

  • Implement Content Security Policy (CSP)
  • Handle user data securely
  • Prevent XSS and injection attacks
  • Use secure messaging between components
  • Handle cross-origin requests safely
  • Implement secure data encryption
  • Follow web_accessible_resources best practices

Performance and Optimization

  • Minimize resource usage and avoid memory leaks
  • Optimize background script performance
  • Implement proper caching mechanisms
  • Handle asynchronous operations efficiently
  • Monitor and optimize CPU/memory usage

UI and User Experience

  • Follow Material Design guidelines
  • Implement responsive popup windows
  • Provide clear user feedback
  • Support keyboard navigation
  • Ensure proper loading states
  • Add appropriate animations

Internationalization

  • Use chrome.i18n API for translations
  • Follow _locales structure
  • Support RTL languages
  • Handle regional formats

Accessibility

  • Implement ARIA labels
  • Ensure sufficient color contrast
  • Support screen readers
  • Add keyboard shortcuts

Testing and Debugging

  • Use Chrome DevTools effectively
  • Write unit and integration tests
  • Test cross-browser compatibility
  • Monitor performance metrics
  • Handle error scenarios

Publishing and Maintenance

  • Prepare store listings and screenshots
  • Write clear privacy policies
  • Implement update mechanisms
  • Handle user feedback
  • Maintain documentation

Follow Official Documentation

  • Refer to Chrome Extension documentation
  • Stay updated with Manifest V3 changes
  • Follow Chrome Web Store guidelines
  • Monitor Chrome platform updates

Output Expectations

  • Provide clear, working code examples
  • Include necessary error handling
  • Follow security best practices
  • Ensure cross-browser compatibility
  • Write maintainable and scalable code

File Structure:

src/
├── popup/           # Popup window related code
├── background/      # Background service code
├── contents/        # Content scripts
├── components/      # Shared components
│   ├── ui/         # UI components
│   └── features/   # Feature components
├── utils/          # Utility functions
├── types/          # Type definitions
└── static/         # Static assets

Chrome API Usage:

  • Properly use chrome.* APIs (storage, tabs, runtime, etc.)
  • Handle asynchronous operations with Promises
  • Use Service Worker for background scripts (MV3 requirement)
// Storage API example
const storage = {
  get: async <T>(key: string): Promise<T | undefined> => {
    const result = await chrome.storage.local.get(key);
    return result[key];
  },
  set: async <T>(key: string, value: T): Promise<void> => {
    await chrome.storage.local.set({ [key]: value });
  }
};

// Tabs API example
const tabs = {
  getCurrentTab: async () => {
    const [tab] = await chrome.tabs.query({
      active: true,
      currentWindow: true
    });
    return tab;
  }
};

Read the full file on GitHub · 171 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 171 lines · 1,074 tokens per session scan A 1df8c5bb5f1b

Subscribe to this mod's changes

chrome-extension is a cursor rule published in the GitHub repository leaperone/MultiPost-Extension (3,278 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,074 tokens to every session, about $0.0054 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.