Upload an extension
Get an API key in the Quickstart. Send the extension as a zip withmanifest.json at its root, in a multipart form field named file. It must be Manifest V3. This small extension marks example.com pages.
content.js holds one line, document.documentElement.dataset.markedBy = "mark-page";. Zip the two files, then upload them.
201.
name and version come from manifest.json. Keep id. There is no update: upload again for a new id.
Load it into a session
Send the ids inextensionIds when you open a session, up to 3. They load before the first page opens and cannot change while the session runs.
extensions, in the order you sent, with the id Chrome gave each one. Use runtimeId in chrome-extension://{runtimeId}/ addresses.
result was mark-page. Leave extensionIds out for a plain browser: an extension changes what sites can see, so only sessions opened with one have it.
List, read and delete
{ "success": true }. After it, reading the id returns 404 notFound with No extension with that id.
Options
Limits and errors
- Manifest V3 only. You can keep 100 extensions.
- A
manifest.jsonwith akeyfield, or with thedebugger,proxy,processes,dns,experimentalorenterprise.*permission, returns400 prohibitedPermission. A real answer fordebugger:The debugger permission is not allowed. - An id that does not exist, or was deleted, returns
404 notFound. - More than 3 ids, or the same id twice, in
extensionIdsreturns400 invalidRequest.
Related
- Browser sessions opens the session that loads the extension.
- Profiles keep logins between sessions.
- Upload reference lists every field.