Overview
The Permission Warnings API converts Chrome extension manifest permissions into human-readable warning messages. It implements Chromium’s permission warning logic to help users understand the security implications of installing extensions.This implementation is derived from Chromium’s source code:
- Rules logic:
chrome/common/extensions/permissions/chrome_permission_message_rules.cc - Message strings:
chrome/app/generated_resources.grd
Why Permission Warnings Matter
When users install browser extensions, they need to understand what capabilities they’re granting. Permission warnings:- Inform users about data access and browser capabilities
- Prevent malicious extensions from gaining access without user awareness
- Follow Chrome’s precedence rules for permission message priority
- Group related permissions to avoid overwhelming users with too many warnings
API Reference
getPermissionWarnings()
Processes manifest permissions and generates user-facing warning messages.
Parameters
manifestPermissions(string[]): Array of permission strings frommanifest.json- Examples:
["tabs", "storage", "history", "bookmarks"]
- Examples:
hostPermissions(string[], optional): Array of host permission strings- Examples:
["<all_urls>", "https://*.google.com/*"]
- Examples:
Returns
string[]: Array of user-facing warning messages
Usage Examples
Basic Permission Warnings
All Sites Permission
Specific Host Permissions
Chrome Web Store Integration
Flow Browser uses this API when displaying extension installation dialogs:Permission Categories
High-Impact Permissions
These permissions have the highest precedence and generate prominent warnings:| Permission | Warning Message |
|---|---|
debugger | Debug extensions and pages |
<all_urls> | Read and change all your data on all websites |
management | Manage your apps, extensions, and themes |
Browser Data Access
| Permission | Warning Message |
|---|---|
history | Read and change your Browse history on all your signed-in devices |
tabs | Read your Browse history |
bookmarks | Read and change your bookmarks |
readingList | Read and change your reading list |
downloads | Manage your downloads |
downloads.open | Open files that you have downloaded |
Clipboard and Input
| Permission | Warning Message |
|---|---|
clipboardRead + clipboardWrite | Read and modify data you copy and paste |
clipboardRead | Read data you copy and paste |
clipboardWrite | Modify data you copy and paste |
input | Monitor keyboard input |
Media Capture
| Permission | Warning Message |
|---|---|
audioCapture + videoCapture | Capture audio and video |
audioCapture | Capture audio |
videoCapture | Capture video |
desktopCapture | Capture content of your screen |
Location and Identity
| Permission | Warning Message |
|---|---|
geolocation | Detect your physical location |
identity.email | Know your email address |
Network and Connectivity
| Permission | Warning Message |
|---|---|
proxy | Read and modify proxy settings |
vpnProvider | Manage VPN connections |
declarativeNetRequest | Block network requests |
declarativeWebRequest | Block parts of web pages |
Device Access
| Permission | Warning Message |
|---|---|
usbDevices | Access USB devices |
bluetooth + serial | Access Bluetooth and serial devices |
bluetooth | Access Bluetooth devices |
serial | Access serial devices |
u2fDevices | Access U2F security keys |
Privacy and Settings
| Permission | Warning Message |
|---|---|
privacy | Change privacy-related settings |
contentSettings | Change settings that control websites’ access to features |
Permission Precedence Rules
The API follows Chromium’s precedence rules:-
Higher-impact permissions suppress lower ones
<all_urls>absorbs many other permissions liketabs,webNavigation- Combined permissions generate a single warning
-
Required and optional permissions
- Each rule specifies required permissions that must all be present
- Optional permissions are consumed if the rule matches
-
First match wins
- Rules are processed in order
- Once a permission is consumed, it won’t trigger later rules
Advanced Examples
Content Script Permissions
Extension with Multiple Capabilities
Debugger Extension
Implementation Details
Permission Mapping
The module maintains mappings from manifest permission strings to internal permission IDs:Permission Messages
Messages are stored in a lookup table:Host Permission Detection
The API detects specific host patterns:Limitations
Known LimitationsThis implementation has some differences from Chromium:
- No dynamic formatting: Uses static messages instead of formatting with host lists
- Simplified host handling: Specific host permissions use generic placeholder messages
- Best-effort mapping: Some C++ API permission IDs may not map perfectly to manifest strings
- No placeholder replacement: Messages with
<ph>tags show raw text - Default environment: Assumes non-ChromeOS environment for conditional messages
ChromeOS-Specific Permissions
Some permissions are specific to ChromeOS:Enterprise Permissions
Enterprise extensions may request special permissions:| Permission | Warning Message |
|---|---|
enterprise.deviceAttributes | See device information, such as its serial number or asset ID |
enterprise.platformKeys | Perform security-related tasks for your organization |
enterprise.reportingPrivate | Read information about your browser, OS, and device |
enterprise.networkingAttributes | See network information, such as your IP or MAC address |
Best Practices
For Extension Developers
For Browser Developers
Testing Permission Warnings
Related APIs
- Extension Overview - Main extension integration
- Extension Locales - Internationalization support