chromeapi 0.0.8 copy "chromeapi: ^0.0.8" to clipboard
chromeapi: ^0.0.8 copied to clipboard

discontinuedreplaced by: chrome_extension
Platformweb

Chrome Extension API wrapper

Chrome Extensions API

Features #

Project is WIP, starting with chrome.tabs mostly implemented (methods, not events).

Prerequisites #

  • Set permissions in manifest.json required to use specifc API's according found at Chrome Reference
  • If building with Flutter,
    • Make the appropriate changes to the normal working directory/files.
      • Examples:
        • manifest.json (example: service workers)
        • index.json

Usage #

Import the library, no use of js namespaces.

So to get chrome.tabs import... `import 'package:chromeapi/tabs.dart';

and as an example on getting the active tab, use query...

Future<Tab> getActiveTab() async {
  QueryInfo queryInfo = QueryInfo(active: true, lastFocusedWindow: true);
  // Chrome library, not like JS namespaces
  // `chrome.tabs.query` just `query` in this case
  List<Tab> tabs = await query(queryInfo);
  return tabs.singleWhere((tab) => tab.url != null && tab.url!.isNotEmpty);
}
4
likes
110
pub points
0%
popularity

Publisher

unverified uploader

Chrome Extension API wrapper

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

js

More

Packages that depend on chromeapi