From magic-powers
Secure browser extensions — CSP configuration, minimal permissions, content script XSS prevention, and handling sensitive data safely.
npx claudepluginhub kienbui1995/magic-powers --plugin magic-powersThis skill uses the workspace's default tool permissions.
- Reviewing extension permissions for Chrome Web Store submission
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
optional_permissions for features users might enable laterhost_permissions: ["<all_urls>"] requires strong justification and detailed privacy policy"*://*.github.com/*" over "<all_urls>"MV3 default CSP (strict):
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
}
unsafe-inline, no unsafe-eval'wasm-unsafe-eval'// ❌ Dangerous — XSS if pageData contains script tags
element.innerHTML = pageData;
// ✅ Safe — text only, no HTML interpretation
element.textContent = pageData;
// ✅ Safe — create elements programmatically
const div = document.createElement('div');
div.textContent = userInput;
container.appendChild(div);
chrome.storage (not encrypted)chrome.identity for OAuth (tokens managed by browser)// Validate message sender in background
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
// Verify sender is your extension (not a malicious page)
if (sender.id !== chrome.runtime.id) return;
// Validate message structure
if (!msg.action || typeof msg.action !== 'string') return;
// Process safely
});
Only expose what's needed:
"web_accessible_resources": [{
"resources": ["images/logo.png"],
"matches": ["*://*.trusted-site.com/*"]
}]
Avoid "matches": ["<all_urls>"] for sensitive resources.
chrome.identity — secure OAuth without exposing tokens to pageweb_accessible_resources — extension files visible to web pages (exposure surface)<all_urls> without strong justification?innerHTML with external/user data (use textContent or DOMParser)?web_accessible_resources scoped to specific match patterns?eval() or dynamic code execution?innerHTML with untrusted data (XSS), hardcoded API keys, eval() usageinnerHTML = userContent in content scripts is XSS — page can inject malicious content through DOMchrome.storage is not encrypted — don't store auth tokens or sensitive data there