The documentScan permission allows a ChromeOS extension to access and import images from attached document scanners.
This is a ChromeOS-only permission. It will have no effect on other operating systems.
What it does
- Grants access to the
chrome.documentScanAPI. - Allows the extension to discover available document scanners connected to the device.
- The extension can then initiate a scan operation, configure scan parameters (like resolution and color mode), and receive the scanned images.
When to use it
This is for extensions designed to work with physical document scanners on ChromeOS devices.
Examples:
- A "scan to cloud" application that scans documents and uploads them to a service like Google Drive or Dropbox.
- A document management application for ChromeOS.
Manifest Declaration
{
"name": "My ChromeOS Scanner App",
"version": "1.0",
"manifest_version": 3,
"permissions": [
"documentScan"
]
}Security & Privacy
Why is it risky?
This permission (only for ChromeOS) lets an extension control a connected document scanner. This means it could potentially scan and access sensitive physical documents like contracts, medical records, or financial statements.
Legitimate apps use this to help you digitize your documents. However, a malicious extension could try to scan documents without your full awareness. The risk is moderate because you generally have to physically place a document in the scanner and initiate the scan yourself, but you should be careful about which extensions you give control over your hardware.
API Usage Example
This example discovers available scanners and initiates a simple scan.
// popup.js or other UI script
const scanButton = document.getElementById('scan');
scanButton.addEventListener('click', async () => {
try {
// chrome.documentScan.scan() asks Chrome to handle scanner discovery
// and selection internally; the user is shown a chooser dialog.
const scanResults = await chrome.documentScan.scan({
mimeTypes: ['image/png']
});
console.log('Scan complete!');
// scanResults.dataUrls contains the scanned images as data URLs.
scanResults.dataUrls.forEach((url, index) => {
console.log(`Image ${index}: ${url.substring(0, 50)}...`);
// Display these images in your extension's UI.
});
} catch (error) {
console.error('Scanning failed:', error);
}
});Extensions with the documentScan permission
Here are some popular browser extensions that use the "documentScan" permission. To explore more, try our Advanced search.
Chrome extensions with "documentScan" permission
Firefox add-ons with "documentScan" permission
References
Related Permissions
- This is a standalone ChromeOS permission with no direct relatives.