-
Notifications
You must be signed in to change notification settings - Fork 3
extensions docs #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rgarcia
merged 7 commits into
main
from
raf/kernel-262-feature-request-ability-to-add-browser-extensions
Oct 14, 2025
Merged
extensions docs #73
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4d3c59f
extensions docs
rgarcia 5b9b1ee
Merge branch 'main' into raf/kernel-262-feature-request-ability-to-ad…
masnwilliams b537260
Merge branch 'main' into raf/kernel-262-feature-request-ability-to-ad…
rgarcia 6307aa0
update pricing page
rgarcia 2c3d6fa
docs: update code samples from OpenAPI
github-actions[bot] f78fac8
pr feedback
rgarcia 9cde35c
Merge branch 'main' into raf/kernel-262-feature-request-ability-to-ad…
rgarcia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| title: "Extensions" | ||
| description: "Use browser extensions in Kernel browsers" | ||
| --- | ||
|
|
||
| Kernel's browsers support running with custom Chrome extensions. | ||
| Chrome extensions must be unpacked and can be uploaded to Kernel via the CLI or API. | ||
|
|
||
| ## Uploading extensions | ||
|
|
||
| Here is a simple example of an unpacked extension: | ||
|
|
||
| <CodeGroup> | ||
| ```js ./my-extension/content-script.js | ||
| document.body.innerHTML = document.body.innerHTML.replace(/AI/g, "A1"); | ||
| ``` | ||
|
|
||
| ```json ./my-extension/manifest.json | ||
| { | ||
| "manifest_version": 3, | ||
| "version": "1.0", | ||
| "name": "AI to A1", | ||
| "description": "Replace AI with A1", | ||
| "content_scripts": [ | ||
| { | ||
| "matches": [ | ||
| "https://*/*" | ||
| ], | ||
| "js": [ | ||
| "content-script.js" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| Once these files are in place, you can upload them to Kernel via the CLI (or [API](/api-reference/extensions/upload-a-browser-extension)): | ||
|
|
||
| ```bash | ||
| kernel extensions upload ./my-extension --name my-extension | ||
| ``` | ||
|
|
||
| Extensions uploaded to Kernel are assigned a random ID, but you can also give them a name for easier reference. | ||
| This name must be unique within your organization. | ||
|
|
||
| ## Using extensions in a browser | ||
|
|
||
| Passing the extension name or ID to the `create` method will load it into the browser: | ||
|
|
||
| <CodeGroup> | ||
| ```typescript Typescript/Javascript | ||
| import { Kernel } from '@onkernel/sdk'; | ||
|
|
||
| const kernel = new Kernel(); | ||
| const kernelBrowser = await kernel.browsers.create({ | ||
| extensions: [{ name: "my-extension" }], | ||
| }); | ||
| ``` | ||
|
|
||
| ```python Python | ||
| import kernel | ||
|
|
||
| client = kernel.Kernel() | ||
| kernel_browser = client.browsers.create(extensions=[{name: 'my-extension'}]) | ||
| ``` | ||
|
|
||
| ```bash CLI | ||
| kernel browsers create --extension my-extension | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
|
|
||
| ## Using extensions directly from the Chrome Web Store | ||
|
|
||
| Kernel's CLI offers a command for fetching and unpacking extensions directly from the Chrome Web Store. | ||
| Simply pass the URL of the extension you want to download and the CLI will download the extension and unpack it into the specified directory. | ||
|
|
||
| ```bash CLI | ||
| kernel extensions download-web-store https://chromewebstore.google.com/detail/shutterfly-address-book-e/lddlpciejomhjehckimopnomegilaocb --to ./downloaded-extension | ||
| ``` | ||
|
|
||
| From here you can upload the extension to Kernel as normal. | ||
|
|
||
| ```bash CLI | ||
| kernel extensions upload ./downloaded-extension --name my-extension | ||
| ``` | ||
|
|
||
| ## Loading an extension into a running browser | ||
|
|
||
| If you have a browser running and would like to load an extension into it after the browser session has started, Kernel also allows you to do that via the CLI (or [API](http://localhost:3000/api-reference/browsers/ad-hoc-upload-one-or-more-unpacked-extensions-to-a-running-browser-instance)): | ||
|
|
||
| ```bash CLI | ||
| kernel browsers extensions upload <session_id> ./my-extension | ||
| ``` | ||
|
|
||
| <Info> | ||
| Note that this will restart the browser process and break any connections to the browser CDP URL. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest putting this in a block: Note that this will restart the browser process and break any connections to the browser CDP URL. |
||
| </Info> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should continue with the example here and just showcase this code snippet:
kernel extensions upload ./downloaded-extension --dws-extension