mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-26 13:19:49 +07:00
Partial fixes for sample list generator (#1464)
* Partial fixes for sample list generator A number of fixes for the sample list generator: - Removes a comment from one of our manifest files, as we don't currently support JSONC. - Ignores the `node_modules` folder since we have recently added some AI samples with a build step. - Adds the `aiOriginTrial` API to the list of recognised APIs. - Updates `extension-apis.json` with the latest data from the `chrome-types` package. Updating recognised extension APIs still requires access to a non-existent storage bucket, so this does not fully fix the process. * Fix linter issue
This commit is contained in:
@@ -43,8 +43,13 @@
|
|||||||
"setPopup",
|
"setPopup",
|
||||||
"setTitle"
|
"setTitle"
|
||||||
],
|
],
|
||||||
"types": ["OpenPopupOptions", "TabDetails", "UserSettings"],
|
"types": [
|
||||||
"events": ["onClicked"]
|
"OpenPopupOptions",
|
||||||
|
"TabDetails",
|
||||||
|
"UserSettings",
|
||||||
|
"UserSettingsChange"
|
||||||
|
],
|
||||||
|
"events": ["onClicked", "onUserSettingsChanged"]
|
||||||
},
|
},
|
||||||
"alarms": {
|
"alarms": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
@@ -55,14 +60,7 @@
|
|||||||
"app.runtime": {
|
"app.runtime": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": [],
|
"methods": [],
|
||||||
"types": [
|
"types": ["EmbedRequest", "LaunchData", "LaunchItem", "LaunchSource"],
|
||||||
"ActionData",
|
|
||||||
"EmbedRequest",
|
|
||||||
"LaunchData",
|
|
||||||
"LaunchItem",
|
|
||||||
"ActionType",
|
|
||||||
"LaunchSource"
|
|
||||||
],
|
|
||||||
"events": ["onEmbedRequested", "onLaunched", "onRestarted"]
|
"events": ["onEmbedRequested", "onLaunched", "onRestarted"]
|
||||||
},
|
},
|
||||||
"app.window": {
|
"app.window": {
|
||||||
@@ -261,7 +259,8 @@
|
|||||||
"types": [
|
"types": [
|
||||||
"BookmarkTreeNode",
|
"BookmarkTreeNode",
|
||||||
"CreateDetails",
|
"CreateDetails",
|
||||||
"BookmarkTreeNodeUnmodifiable"
|
"BookmarkTreeNodeUnmodifiable",
|
||||||
|
"FolderType"
|
||||||
],
|
],
|
||||||
"events": [
|
"events": [
|
||||||
"onChanged",
|
"onChanged",
|
||||||
@@ -373,7 +372,7 @@
|
|||||||
"contentScripts": {
|
"contentScripts": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": [],
|
"methods": [],
|
||||||
"types": ["ContentScript", "RunAt"],
|
"types": ["ContentScript"],
|
||||||
"events": []
|
"events": []
|
||||||
},
|
},
|
||||||
"contentSettings": {
|
"contentSettings": {
|
||||||
@@ -420,17 +419,25 @@
|
|||||||
"contextMenus": {
|
"contextMenus": {
|
||||||
"properties": ["ACTION_MENU_TOP_LEVEL_LIMIT"],
|
"properties": ["ACTION_MENU_TOP_LEVEL_LIMIT"],
|
||||||
"methods": ["create", "remove", "removeAll", "update"],
|
"methods": ["create", "remove", "removeAll", "update"],
|
||||||
"types": ["OnClickData", "ContextType", "ItemType"],
|
"types": ["CreateProperties", "OnClickData", "ContextType", "ItemType"],
|
||||||
"events": ["onClicked"]
|
"events": ["onClicked"]
|
||||||
},
|
},
|
||||||
"cookies": {
|
"cookies": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["get", "getAll", "getAllCookieStores", "remove", "set"],
|
"methods": [
|
||||||
|
"get",
|
||||||
|
"getAll",
|
||||||
|
"getAllCookieStores",
|
||||||
|
"getPartitionKey",
|
||||||
|
"remove",
|
||||||
|
"set"
|
||||||
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"Cookie",
|
"Cookie",
|
||||||
"CookieDetails",
|
"CookieDetails",
|
||||||
"CookiePartitionKey",
|
"CookiePartitionKey",
|
||||||
"CookieStore",
|
"CookieStore",
|
||||||
|
"FrameDetails",
|
||||||
"OnChangedCause",
|
"OnChangedCause",
|
||||||
"SameSiteStatus"
|
"SameSiteStatus"
|
||||||
],
|
],
|
||||||
@@ -445,7 +452,13 @@
|
|||||||
"debugger": {
|
"debugger": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["attach", "detach", "getTargets", "sendCommand"],
|
"methods": ["attach", "detach", "getTargets", "sendCommand"],
|
||||||
"types": ["Debuggee", "TargetInfo", "DetachReason", "TargetInfoType"],
|
"types": [
|
||||||
|
"Debuggee",
|
||||||
|
"DebuggerSession",
|
||||||
|
"TargetInfo",
|
||||||
|
"DetachReason",
|
||||||
|
"TargetInfoType"
|
||||||
|
],
|
||||||
"events": ["onDetach", "onEvent"]
|
"events": ["onDetach", "onEvent"]
|
||||||
},
|
},
|
||||||
"declarativeContent": {
|
"declarativeContent": {
|
||||||
@@ -495,6 +508,7 @@
|
|||||||
"ExtensionActionOptions",
|
"ExtensionActionOptions",
|
||||||
"GetDisabledRuleIdsOptions",
|
"GetDisabledRuleIdsOptions",
|
||||||
"GetRulesFilter",
|
"GetRulesFilter",
|
||||||
|
"HeaderInfo",
|
||||||
"IsRegexSupportedResult",
|
"IsRegexSupportedResult",
|
||||||
"MatchedRule",
|
"MatchedRule",
|
||||||
"MatchedRuleInfo",
|
"MatchedRuleInfo",
|
||||||
@@ -591,6 +605,12 @@
|
|||||||
],
|
],
|
||||||
"events": []
|
"events": []
|
||||||
},
|
},
|
||||||
|
"devtools.performance": {
|
||||||
|
"properties": [],
|
||||||
|
"methods": [],
|
||||||
|
"types": [],
|
||||||
|
"events": ["onProfilingStarted", "onProfilingStopped"]
|
||||||
|
},
|
||||||
"devtools.recorder": {
|
"devtools.recorder": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["createView", "registerRecorderExtensionPlugin"],
|
"methods": ["createView", "registerRecorderExtensionPlugin"],
|
||||||
@@ -611,8 +631,43 @@
|
|||||||
},
|
},
|
||||||
"documentScan": {
|
"documentScan": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["scan"],
|
"methods": [
|
||||||
"types": ["ScanOptions", "ScanResults"],
|
"cancelScan",
|
||||||
|
"closeScanner",
|
||||||
|
"getOptionGroups",
|
||||||
|
"getScannerList",
|
||||||
|
"openScanner",
|
||||||
|
"readScanData",
|
||||||
|
"scan",
|
||||||
|
"setOptions",
|
||||||
|
"startScan"
|
||||||
|
],
|
||||||
|
"types": [
|
||||||
|
"CancelScanResponse",
|
||||||
|
"CloseScannerResponse",
|
||||||
|
"DeviceFilter",
|
||||||
|
"GetOptionGroupsResponse",
|
||||||
|
"GetScannerListResponse",
|
||||||
|
"OpenScannerResponse",
|
||||||
|
"OptionConstraint",
|
||||||
|
"OptionGroup",
|
||||||
|
"OptionSetting",
|
||||||
|
"ReadScanDataResponse",
|
||||||
|
"ScanOptions",
|
||||||
|
"ScanResults",
|
||||||
|
"ScannerInfo",
|
||||||
|
"ScannerOption",
|
||||||
|
"SetOptionResult",
|
||||||
|
"SetOptionsResponse",
|
||||||
|
"StartScanOptions",
|
||||||
|
"StartScanResponse",
|
||||||
|
"Configurability",
|
||||||
|
"ConnectionType",
|
||||||
|
"ConstraintType",
|
||||||
|
"OperationResult",
|
||||||
|
"OptionType",
|
||||||
|
"OptionUnit"
|
||||||
|
],
|
||||||
"events": []
|
"events": []
|
||||||
},
|
},
|
||||||
"dom": {
|
"dom": {
|
||||||
@@ -677,6 +732,12 @@
|
|||||||
"types": ["HardwarePlatformInfo"],
|
"types": ["HardwarePlatformInfo"],
|
||||||
"events": []
|
"events": []
|
||||||
},
|
},
|
||||||
|
"enterprise.kioskInput": {
|
||||||
|
"properties": [],
|
||||||
|
"methods": ["setCurrentInputMethod"],
|
||||||
|
"types": ["SetCurrentInputMethodOptions"],
|
||||||
|
"events": []
|
||||||
|
},
|
||||||
"enterprise.networkingAttributes": {
|
"enterprise.networkingAttributes": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["getNetworkDetails"],
|
"methods": ["getNetworkDetails"],
|
||||||
@@ -733,6 +794,7 @@
|
|||||||
"InjectDetails",
|
"InjectDetails",
|
||||||
"CSSOrigin",
|
"CSSOrigin",
|
||||||
"DocumentLifecycle",
|
"DocumentLifecycle",
|
||||||
|
"ExecutionWorld",
|
||||||
"FrameType",
|
"FrameType",
|
||||||
"ImageFormat",
|
"ImageFormat",
|
||||||
"RunAt"
|
"RunAt"
|
||||||
@@ -799,6 +861,7 @@
|
|||||||
"AddWatcherRequestedOptions",
|
"AddWatcherRequestedOptions",
|
||||||
"Change",
|
"Change",
|
||||||
"CloseFileRequestedOptions",
|
"CloseFileRequestedOptions",
|
||||||
|
"CloudFileInfo",
|
||||||
"CloudIdentifier",
|
"CloudIdentifier",
|
||||||
"ConfigureRequestedOptions",
|
"ConfigureRequestedOptions",
|
||||||
"CopyEntryRequestedOptions",
|
"CopyEntryRequestedOptions",
|
||||||
@@ -1245,7 +1308,14 @@
|
|||||||
},
|
},
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["contains", "getAll", "remove", "request"],
|
"methods": [
|
||||||
|
"addHostAccessRequest",
|
||||||
|
"contains",
|
||||||
|
"getAll",
|
||||||
|
"remove",
|
||||||
|
"removeHostAccessRequest",
|
||||||
|
"request"
|
||||||
|
],
|
||||||
"types": ["Permissions"],
|
"types": ["Permissions"],
|
||||||
"events": ["onAdded", "onRemoved"]
|
"events": ["onAdded", "onRemoved"]
|
||||||
},
|
},
|
||||||
@@ -1290,7 +1360,13 @@
|
|||||||
"MAX_GET_PRINTER_INFO_CALLS_PER_MINUTE",
|
"MAX_GET_PRINTER_INFO_CALLS_PER_MINUTE",
|
||||||
"MAX_SUBMIT_JOB_CALLS_PER_MINUTE"
|
"MAX_SUBMIT_JOB_CALLS_PER_MINUTE"
|
||||||
],
|
],
|
||||||
"methods": ["cancelJob", "getPrinterInfo", "getPrinters", "submitJob"],
|
"methods": [
|
||||||
|
"cancelJob",
|
||||||
|
"getJobStatus",
|
||||||
|
"getPrinterInfo",
|
||||||
|
"getPrinters",
|
||||||
|
"submitJob"
|
||||||
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"GetPrinterInfoResponse",
|
"GetPrinterInfoResponse",
|
||||||
"Printer",
|
"Printer",
|
||||||
@@ -1408,7 +1484,9 @@
|
|||||||
"onStartup",
|
"onStartup",
|
||||||
"onSuspend",
|
"onSuspend",
|
||||||
"onSuspendCanceled",
|
"onSuspendCanceled",
|
||||||
"onUpdateAvailable"
|
"onUpdateAvailable",
|
||||||
|
"onUserScriptConnect",
|
||||||
|
"onUserScriptMessage"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripting": {
|
"scripting": {
|
||||||
@@ -1719,6 +1797,12 @@
|
|||||||
],
|
],
|
||||||
"events": ["onAttached", "onDetached"]
|
"events": ["onAttached", "onDetached"]
|
||||||
},
|
},
|
||||||
|
"systemLog": {
|
||||||
|
"properties": [],
|
||||||
|
"methods": ["add"],
|
||||||
|
"types": ["MessageOptions"],
|
||||||
|
"events": []
|
||||||
|
},
|
||||||
"tabCapture": {
|
"tabCapture": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["capture", "getCapturedTabs", "getMediaStreamId"],
|
"methods": ["capture", "getCapturedTabs", "getMediaStreamId"],
|
||||||
@@ -1738,7 +1822,11 @@
|
|||||||
"events": ["onCreated", "onMoved", "onRemoved", "onUpdated"]
|
"events": ["onCreated", "onMoved", "onRemoved", "onUpdated"]
|
||||||
},
|
},
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"properties": ["MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND", "TAB_ID_NONE"],
|
"properties": [
|
||||||
|
"MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND",
|
||||||
|
"TAB_ID_NONE",
|
||||||
|
"TAB_INDEX_NONE"
|
||||||
|
],
|
||||||
"methods": [
|
"methods": [
|
||||||
"captureVisibleTab",
|
"captureVisibleTab",
|
||||||
"connect",
|
"connect",
|
||||||
@@ -1806,23 +1894,31 @@
|
|||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["getVoices", "isSpeaking", "pause", "resume", "speak", "stop"],
|
"methods": ["getVoices", "isSpeaking", "pause", "resume", "speak", "stop"],
|
||||||
"types": ["TtsEvent", "TtsOptions", "TtsVoice", "EventType", "VoiceGender"],
|
"types": ["TtsEvent", "TtsOptions", "TtsVoice", "EventType", "VoiceGender"],
|
||||||
"events": []
|
"events": ["onVoicesChanged"]
|
||||||
},
|
},
|
||||||
"ttsEngine": {
|
"ttsEngine": {
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": ["updateVoices"],
|
"methods": ["updateLanguage", "updateVoices"],
|
||||||
"types": [
|
"types": [
|
||||||
"AudioBuffer",
|
"AudioBuffer",
|
||||||
"AudioStreamOptions",
|
"AudioStreamOptions",
|
||||||
|
"LanguageStatus",
|
||||||
|
"LanguageUninstallOptions",
|
||||||
"SpeakOptions",
|
"SpeakOptions",
|
||||||
|
"TtsClient",
|
||||||
|
"LanguageInstallStatus",
|
||||||
|
"TtsClientSource",
|
||||||
"VoiceGender"
|
"VoiceGender"
|
||||||
],
|
],
|
||||||
"events": [
|
"events": [
|
||||||
|
"onInstallLanguageRequest",
|
||||||
|
"onLanguageStatusRequest",
|
||||||
"onPause",
|
"onPause",
|
||||||
"onResume",
|
"onResume",
|
||||||
"onSpeak",
|
"onSpeak",
|
||||||
"onSpeakWithAudioStream",
|
"onSpeakWithAudioStream",
|
||||||
"onStop"
|
"onStop",
|
||||||
|
"onUninstallLanguageRequest"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"types": {
|
"types": {
|
||||||
@@ -1880,15 +1976,21 @@
|
|||||||
"properties": [],
|
"properties": [],
|
||||||
"methods": [
|
"methods": [
|
||||||
"configureWorld",
|
"configureWorld",
|
||||||
|
"execute",
|
||||||
"getScripts",
|
"getScripts",
|
||||||
|
"getWorldConfigurations",
|
||||||
"register",
|
"register",
|
||||||
|
"resetWorldConfiguration",
|
||||||
"unregister",
|
"unregister",
|
||||||
"update"
|
"update"
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
|
"InjectionResult",
|
||||||
|
"InjectionTarget",
|
||||||
"RegisteredUserScript",
|
"RegisteredUserScript",
|
||||||
"ScriptSource",
|
"ScriptSource",
|
||||||
"UserScriptFilter",
|
"UserScriptFilter",
|
||||||
|
"UserScriptInjection",
|
||||||
"WorldProperties",
|
"WorldProperties",
|
||||||
"ExecutionWorld"
|
"ExecutionWorld"
|
||||||
],
|
],
|
||||||
@@ -2056,6 +2158,7 @@
|
|||||||
"FindOptions",
|
"FindOptions",
|
||||||
"FullscreenPermissionRequest",
|
"FullscreenPermissionRequest",
|
||||||
"GeolocationPermissionRequest",
|
"GeolocationPermissionRequest",
|
||||||
|
"HidPermissionRequest",
|
||||||
"InjectDetails",
|
"InjectDetails",
|
||||||
"InjectionItems",
|
"InjectionItems",
|
||||||
"LoadPluginPermissionRequest",
|
"LoadPluginPermissionRequest",
|
||||||
|
|||||||
@@ -15,5 +15,16 @@ export const loadExtensionApis = (): ExtensionApiMap => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let data = fs.readFileSync(filePath, 'utf8');
|
let data = fs.readFileSync(filePath, 'utf8');
|
||||||
return JSON.parse(data);
|
const apiMap = JSON.parse(data);
|
||||||
|
|
||||||
|
// Due to the specific implementation of this API, we need to manually add it
|
||||||
|
// to the list of APIs recognised by the sample list generator.
|
||||||
|
apiMap['aiOriginTrial.languageModel'] = {
|
||||||
|
properties: [],
|
||||||
|
methods: ['create', 'capabilities', 'params', 'availability'],
|
||||||
|
types: [],
|
||||||
|
events: []
|
||||||
|
};
|
||||||
|
|
||||||
|
return apiMap;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export const getAllFiles = async (dir: string): Promise<string[]> => {
|
|||||||
if (stats.isFile()) {
|
if (stats.isFile()) {
|
||||||
result.push(filePath);
|
result.push(filePath);
|
||||||
} else if (stats.isDirectory()) {
|
} else if (stats.isDirectory()) {
|
||||||
|
if (file === "node_modules") continue;
|
||||||
result.push(...(await getAllFiles(filePath)));
|
result.push(...(await getAllFiles(filePath)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
},
|
},
|
||||||
"permissions": ["identity", "identity.email"],
|
"permissions": ["identity", "identity.email"],
|
||||||
"oauth2": {
|
"oauth2": {
|
||||||
// client_id below is specific to the application key. Follow the
|
|
||||||
// documentation to obtain one for your app.
|
|
||||||
"client_id": "497291774654.apps.googleusercontent.com",
|
"client_id": "497291774654.apps.googleusercontent.com",
|
||||||
"scopes": ["https://www.googleapis.com/auth/userinfo.profile"]
|
"scopes": ["https://www.googleapis.com/auth/userinfo.profile"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,9 +46,7 @@ async function initDefaults() {
|
|||||||
console.log('Model default:', defaults);
|
console.log('Model default:', defaults);
|
||||||
const available = await chrome.aiOriginTrial.languageModel.availability();
|
const available = await chrome.aiOriginTrial.languageModel.availability();
|
||||||
if (available !== 'available') {
|
if (available !== 'available') {
|
||||||
showResponse(
|
showResponse(`Model not yet available (current state: "${available}")`);
|
||||||
`Model not yet available (current state: "${available}")`
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sliderTemperature.value = defaults.defaultTemperature;
|
sliderTemperature.value = defaults.defaultTemperature;
|
||||||
|
|||||||
Reference in New Issue
Block a user