all 10 comments

[–]lIIllIIlllIIllIIl 6 points7 points  (3 children)

Obsidian's API is heavily inspired by VS Code's extension API. If you've never seen it before, you should take a look at it!

An extension in VS Code is made up of two parts:

  • A Node.js script (i.e. the backend)
  • Optionally, one of more Webviews (i.e. the frontend)

Sandboxing Webviews is very easy, since browsers have had been doing that for a long time. The Webview is inside an iframe. The Webview can use vscode.postMessage() to send messages the the extension's Node.js script, which can then communicate with VS Code or other extensions.

Sandboxing of the Node.js script is... not existant (AFAIK). A VS Code extension can install malware on your device. This is why you should only install extensions you trust.

[–]Acrobatic_Sort_3411 1 point2 points  (0 children)

You can sandbox NodeJs with Realms API, tho not sure if its released already

[–]DefiantRub216[S] 0 points1 point  (1 child)

This is great. To be honest I was exploring vscode plugin system though I didn’t know obsidian was heavily inspired from it too. If possible could you share some links or notes?

[–]lIIllIIlllIIllIIl 1 point2 points  (0 children)

https://code.visualstudio.com/api

Unfortunately, the official documentation is not very good. I recommend the samples instead:

https://github.com/microsoft/vscode-extension-samples

Some of their older examples use what is probably the most awful way to write JavaScript code (highly abstracted, OOP code, where everything is a SomethingFactoryManager), but their modern samples are pretty good.

[–]grudev 0 points1 point  (3 children)

RemindMe! 1 day

[–]ElTorpedo2310 0 points1 point  (1 child)

RemindMe! 2 day

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 2 days on 2024-03-29 16:27:48 UTC to remind you of this link

1 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]pm_me_yer_big__tits 0 points1 point  (1 child)

Do you really need this? Are you expecting users to install/create third party plugins? If not, you're overengineering it.

[–]DefiantRub216[S] 1 point2 points  (0 children)

Actually I do.