문제

Is it possible? I tried to insert the google dart api into page body and all I get is blank page, no script running...

도움이 되었습니까?

해결책

You can currently not use Dart for writing extensions in Chrome as Dart is not available in it. There exists a Chromium version called Dartium that has Dart support build in, but the extension API in it does not seam to be Dart enabled just yet.

다른 팁

There is the cool package chrome available at http://pub.dartlang.org that does axactly this

A library for accessing the Chrome APIs in a packaged app or extension.

Yes, it is straight forward. You need to create 3 Dart apps (for background, popup and options page) and use the dart:js package to communicate with the chrome extensions API.

Kudos to Chris Bucket for the blog entry about Using Dart for Chrome Packaged Apps.

UPDATE: It looks like the website from Chris Bucket has disappeared.

Dart is isolated form javascript and there is no common points to make calls between them. You can't even call any JS function from Dart. As long there is no dedicated interface for extensions API it isn't possible. But I looking forward to have this feature as well :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top