Skip to content

Commit 7ac4508

Browse files
authored
feat: new extension type View (#894)
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
1 parent 450bacc commit 7ac4508

27 files changed

Lines changed: 1806 additions & 302 deletions

File tree

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Information about release notes of Coco App is provided here.
2525
- feat: file search for Linux/GNOME #884
2626
- feat: file search for Linux/KDE #886
2727
- feat: extension Window Management for macOS #892
28+
- feat: new extension type View #894
2829

2930

3031
### 🐛 Bug fix

0 commit comments

Comments
 (0)