mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
feedback
This commit is contained in:
@@ -688,21 +688,23 @@ advancedFonts.applyImportedSettings = async function (config) {
|
||||
|
||||
if (Array.isArray(config.configuredFonts)) {
|
||||
config.configuredFonts.forEach(({ script, scriptData }) => {
|
||||
scriptData.forEach(async ({ fontId, genericFamily }) => {
|
||||
if (isString(fontId, genericFamily, script)) {
|
||||
try {
|
||||
await chrome.fontSettings.setFont({
|
||||
fontId,
|
||||
genericFamily,
|
||||
script
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
`Unable to set ${script},${fonId},${genericFamily}: ${e}`
|
||||
);
|
||||
if (Array.isArray(scriptData)) {
|
||||
scriptData.forEach(async ({ fontId, genericFamily }) => {
|
||||
if (isString(fontId, genericFamily, script)) {
|
||||
try {
|
||||
await chrome.fontSettings.setFont({
|
||||
fontId,
|
||||
genericFamily,
|
||||
script
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(
|
||||
`Unable to set ${script},${fonId},${genericFamily}: ${e}`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (typeof config.configuredFonts !== 'undefined') {
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user