printerProvider

The printerProvider permission allows an extension to implement a print service, exposing printers to the Chrome print preview dialog. It works on every desktop platform where the Chrome print preview is available (Windows, macOS, Linux, ChromeOS).

What it does

  • Grants access to the chrome.printerProvider API.
  • Allows an extension to register itself as a source of printers.
  • The extension can then provide a list of printers it manages (e.g., cloud-based printers, network printers with custom protocols).
  • When a user tries to print to one of these printers, the extension receives the print job data and is responsible for sending it to the physical printer.

When to use it

This is for extensions that integrate with third-party printing services or manage printers in a corporate environment on ChromeOS.

Examples:

  • An extension for a cloud printing service that allows users to print from their Chromebooks.
  • A corporate extension that exposes and manages a fleet of network printers.

Manifest Declaration

{
  "name": "My Cloud Print Service",
  "version": "1.0",
  "manifest_version": 3,
  "permissions": [
    "printerProvider"
  ],
  "background": {
    "service_worker": "background.js"
  }
}

Security & Privacy

Why is it low risk?

This permission allows an extension to add its own printers to the print menu, for example, a "Print to Cloud Service" option.

The risk is low because you are always in control. The extension can only see the contents of a document if you explicitly choose to print to the special printer it provides. It cannot see any other documents or access your other files or browsing data. You should still only use printer services from companies you trust with your documents.

API Usage Example

The API is event-driven. This is a simplified conceptual example.

// background.js

// This event is fired when Chrome needs a list of available printers.
chrome.printerProvider.onGetPrintersRequested.addListener((resultCallback) => {
  // In a real app, you would discover or fetch this list.
  const myPrinters = [
    { id: 'printer1', name: 'My Cloud Printer A' },
    { id: 'printer2', name: 'My Cloud Printer B' }
  ];
  resultCallback(myPrinters);
});

// This event is fired when the user initiates a print job.
chrome.printerProvider.onPrintRequested.addListener((printJob, resultCallback) => {
  console.log(`Print job received for printer: ${printJob.printerId}`);
  console.log(`Document has ${printJob.document.byteLength} bytes.`);

  // Here, you would send the printJob.document (an ArrayBuffer)
  // to your printing service or the physical printer.

  // Report success or failure.
  resultCallback('OK'); // or 'FAILED'
});

Extensions with the printerProvider permission

Here are some popular browser extensions that use the "printerProvider" permission. To explore more, try our Advanced search.

References


Related Permissions

Permission Metrics

Popularity

Security Risk


Usage by Platform