Conversation
54eecd6 to
91f77bb
Compare
07426e2 to
df242ae
Compare
This commit introduces a new extension type View, which enables developers
to implement extensions with GUI. It is implemented using iframe, developers
can specify the path to the HTML file in the `Extension.page` field, then
Coco will load and render that page when the extension gets opened.
coco-api
We provide a TypeScript library [1] that will contain the APIs developers
need to make the experience better.
We start from file system APIs. Since the embedded HTML page will be loaded
by WebView, which has no access to the local file system, we provide APIs
to bridge that gap. Currently, `fs:read_dir()` is the only API we implemented, more
will come soon.
Permission
As View extensions run user-provided code, we introduce a permision
mechanism to sandbox the code. Developers must manually specify the
permission their extension needs in the "plugin.json" file, e,g.:
"permissions": {
"fs": [
{ "path": "/Users/foo/Downloads", "access": ["read", "write"] },
{ "path": "/Users/foo/Documents", "access": ["read"] }
],
"http": [
{ "host": "api.github.com" }
],
"api": ["fs:read_dir"]
}
Currently, both fs and api permissions are implemented. Permission checks
apply only to View extensions for now; Command extensions will support
them in the future.
[1]: https://github.com/infinilabs/coco-api
f7097c3 to
a7a904b
Compare
ayangweb
approved these changes
Sep 25, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit introduces a new extension type View, which enables developers to implement extensions with GUI. It is implemented using iframe, developers can specify the path to the HTML file in the
Extension.pagefield, then Coco will load and render that page when the extension gets opened.coco-api
We provide a TypeScript library 1 that will contain the APIs developers need to make the experience better.
We start from file system APIs. Since the embedded HTML page will be loaded by WebView, which has no access to the local file system, we provide APIs to bridge that gap. Currently,
fs:read_dir()is the only API we implemented, more will come soon.Permission
As View extensions run user-provided code, we introduce a permision mechanism to sandbox the code. Developers must manually specify the permission their extension needs in the "plugin.json" file, e,g.:
Currently, both fs and api permissions are implemented. Permission checks apply only to View extensions for now; Command extensions will support them in the future.
Standards checklist