The fontSettings permission allows an extension to access and modify the browser's font settings.
What it does
- Grants access to the
chrome.fontSettingsAPI. - Allows an extension to get and set the default font families for different script types (e.g., standard, serif, sans-serif, cursive).
- Can also control the default font size.
When to use it
This is primarily for accessibility extensions or extensions that provide enhanced customization of the browsing experience.
Examples:
- An accessibility extension that allows users to set a specific dyslexic-friendly font as the browser default.
- A customization extension that lets users easily switch between different font profiles.
- A language-learning tool that changes the default font for a specific language's script to one that is easier to read.
Manifest Declaration
{
"name": "My Font Customizer",
"version": "1.0",
"manifest_version": 3,
"permissions": [
"fontSettings"
]
}Security & Privacy
Why is it not risky?
This permission allows an extension to change the default fonts used in your browser. For example, it could make all text appear in a different style or size.
This is a safe permission. While a poorly designed extension could make text hard to read, it cannot access any of your personal data or harm your computer.
API Usage Example
This example sets the default "standard" font to "Comic Sans MS" and the default font size to 18.
// popup.js or options.js
async function setCustomFonts() {
try {
// Set the standard font
await new Promise((resolve, reject) => {
chrome.fontSettings.setFont({
genericFamily: 'standard',
fontId: 'Comic Sans MS'
}, () => chrome.runtime.lastError ? reject(chrome.runtime.lastError) : resolve());
});
console.log('Standard font set to Comic Sans MS.');
// Set the default font size
await new Promise((resolve, reject) => {
chrome.fontSettings.setDefaultFontSize({
pixelSize: 18
}, () => chrome.runtime.lastError ? reject(chrome.runtime.lastError) : resolve());
});
console.log('Default font size set to 18px.');
} catch (error) {
console.error('Failed to set font settings:', error);
}
}
// Call this from a user action, like a button click
// setCustomFonts();Extensions with the fontSettings permission
Here are some popular browser extensions that use the "fontSettings" permission. To explore more, try our Advanced search.
Chrome extensions with "fontSettings" permission
Edge add-ons with "fontSettings" permission
Firefox add-ons with "fontSettings" permission
References
Related Permissions
- This is a standalone permission with no direct relatives.