extension-host-permissions

Requests runtime host permissions for Chrome extension content scripts on arbitrary sites.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/missingbulb/GoogleCalendarEventCreator --skill extension-host-permissions-missingbulb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extension-host-permissions
Source: https://github.com/missingbulb/GoogleCalendarEventCreator/tree/main/.claudinite/shared/packs/chrome-extension/skills/extension-host-permissions
Command: npx skills add https://github.com/missingbulb/GoogleCalendarEventCreator --skill extension-host-permissions-missingbulb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Chrome extensions that declare broad host permissions at install time trigger scary install warnings that drive users away. This Skill shows how to run content scripts on arbitrary third-party pages by requesting host access at runtime instead, avoiding the install-time warning entirely. ## Core Features & Use Cases - Runtime Permission Requests: Declare origins under optional_host_permissions and call chrome.permissions.request() synchronously inside a real foreground user gesture, since Chrome rejects requests from service-worker message handlers. - Dynamic Script Registration: Register content scripts with chrome.scripting.registerContentScripts() instead of static content_scripts manifest entries, using the silent scripting permission. - Grant Reconciliation: On every service worker start, compare your stored enabled-flag against the actually granted permission and re-register or clean up, since users can revoke the grant from chrome://extensions. - Use Case: You are building an extension that reads event details from any web page the user visits. Use this Skill to request site access only when the user clicks your toolbar button, then dynamically inject the content script without ever showing an install-time host warning. ## Quick Start Use the extension-host-permissions skill to set up runtime host permission requests and dynamic content script registration in my Chrome extension manifest.

Frequently Asked Questions about extension-host-permissions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a content script on any website without an install warning?

Declare the origins under optional_host_permissions in the manifest, then call chrome.permissions.request() at runtime inside a user gesture. After the grant, register the script dynamically with chrome.scripting.registerContentScripts() instead of a static content_scripts entry.

Why does chrome.permissions.request fail from a service worker?

Chrome rejects permission requests that are not made synchronously inside a real foreground user gesture. A service-worker message handler does not qualify, so the request must originate from a foreground context like a popup or page click handler.

What is optional_host_permissions in a Chrome extension manifest?

optional_host_permissions lists origins the extension may request at runtime rather than at install time. This avoids the install-time host warning while still allowing content scripts to run on those sites once the user grants access.

Can users revoke runtime host permissions after granting them?

Yes, users can revoke the grant at any time from chrome://extensions. Your service worker should reconcile its stored enabled-flag against the actually granted permission on every start and re-register or clean up accordingly.

Should I use static content_scripts or dynamic registration?

Use chrome.scripting.registerContentScripts() for runtime-granted host access, never a static content_scripts entry. Static entries require install-time host permissions, which trigger the warning this approach avoids.