2

I want to use libvirt api from dart program. Here is the doc https://www.dartlang.org/articles/native-extensions-for-standalone-dart-vm/. But i find it's only usable in dart command line app, so is dart.io. I am not familiar with web app, i wonder why this is happening and why we can not invoke system API in a web app. Is it just impossible or there are other tricks to get that done?

Edit: If i really want to writ a web app which invoke libvirt c api in the system, what should i do? For the first one, i can write a backend server to supply api(REST maybe) to the web app. But what if i don't want to have a server backend, and is it possible to access libvirt api from a chrome extension. I saw chrome extension can run as background app, which i think may be not web app.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
apporc
  • 870
  • 3
  • 11
  • 23
  • I don't know much about chrome extensions, but there are fewer limitations. I'm not sure about this but I think you still can't access the system directly but only an API of Chrome that provides some functionality like file access. But I may be wrong here. Please consider asking a new question instead of changing an existing one. The direction of the question changed quite a bit. – Günter Zöchbauer Jan 24 '14 at 06:23

1 Answers1

6

Web apps run in the browser and don't have access to the system directly which is what dart:io is about. This would be a serious security issue if arbitrary websites had access to your local file system/network/... . This is no Dart limitation.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567