The vpnProvider permission allows a ChromeOS extension to implement a VPN (Virtual Private Network) client.
This is a ChromeOS-only permission.
What it does
- Grants access to the
chrome.vpnProviderAPI. - Allows an extension to create and manage VPN configurations in the ChromeOS network settings.
- The extension is responsible for handling the entire lifecycle of the VPN connection, including:
- Establishing the connection to the VPN server.
- Handling authentication.
- Routing network traffic through the VPN tunnel.
When to use it
This is for creating VPN client applications on ChromeOS.
Examples:
- An extension from a commercial VPN provider that allows users to connect to their service.
- A corporate VPN client that connects employees to the company's internal network.
Manifest Declaration
{
"name": "My ChromeOS VPN",
"version": "1.0",
"manifest_version": 3,
"permissions": [
"vpnProvider"
],
"background": {
"service_worker": "background.js"
}
}Security & Privacy
Why is it risky?
This permission (only for ChromeOS) is equivalent to the proxy permission. It allows an extension to act as a VPN, which means it can reroute all of your device's internet traffic through its own servers.
A legitimate VPN service uses this to protect your privacy. However, a malicious "free VPN" extension could use this to:
- Monitor all your internet activity.
- Steal your passwords and financial information.
- Inject ads or malware into websites.
You should only use VPN provider extensions from well-known, highly trusted security companies.
API Usage Example
The API is complex and event-driven. This is a highly simplified conceptual example.
// background.js
// Create a new VPN configuration. This is usually done from a UI page.
chrome.vpnProvider.createConfig("MyVPN", (id) => {
console.log(`VPN configuration created with ID: ${id}`);
});
// Listen for when the user tries to connect
chrome.vpnProvider.onPlatformMessage.addListener((id, message, error) => {
if (message === 'connect') {
console.log('User requested to connect...');
// Begin connection logic to your VPN server...
// Once connected, notify the platform of the connection state
// and the IP parameters for the tunnel.
chrome.vpnProvider.notifyConnectionStateChanged('connected');
chrome.vpnProvider.setParameters({
address: '192.168.1.100',
subnetMask: '255.255.255.0',
// ... and other network parameters
}, () => {
console.log('VPN connection established and parameters set.');
});
} else if (message === 'disconnect') {
// Handle disconnection
}
});Extensions with the vpnProvider permission
Here are some popular browser extensions that use the "vpnProvider" permission. To explore more, try our Advanced search.