chrome_extension 0.1.0 chrome_extension: ^0.1.0 copied to clipboard
A library for accessing the `chrome.*` APIs available in Chrome extensions.
chrome_extension #
A library for accessing the chrome.*
APIs available in Chrome extensions.
This allows to build Chrome extension with Dart & Flutter and to interop with the native APIs easily with a high-level type-safe interface.
The JS interop is build on top of dart:js_interop
(static interop) which make it ready for future WASM compilation.
Using the library #
Example #
import 'package:chrome_extension/alarms.dart';
import 'package:chrome_extension/power.dart';
import 'package:chrome_extension/storage.dart';
void main() async {
// Use the chrome.power API
chrome.power.requestKeepAwake(Level.display);
// Use the chrome.storage API
await chrome.storage.sync.set({'mykey': 'value'});
var values = await chrome.storage.sync.get(null /* all */);
print(values['mykey']);
// Use the chrome.alarms API
await chrome.alarms.create('MyAlarm', AlarmCreateInfo(delayInMinutes: 2));
}
Available APIs #
package:chrome_extension/accessibility_features.dart
(API reference)package:chrome_extension/action.dart
(API reference)package:chrome_extension/alarms.dart
(API reference)package:chrome_extension/audio.dart
(API reference)package:chrome_extension/bookmarks.dart
(API reference)package:chrome_extension/browser_action.dart
(API reference)package:chrome_extension/browsing_data.dart
(API reference)package:chrome_extension/certificate_provider.dart
(API reference)package:chrome_extension/commands.dart
(API reference)package:chrome_extension/content_settings.dart
(API reference)package:chrome_extension/context_menus.dart
(API reference)package:chrome_extension/cookies.dart
(API reference)package:chrome_extension/debugger.dart
(API reference)package:chrome_extension/declarative_content.dart
(API reference)package:chrome_extension/declarative_net_request.dart
(API reference)package:chrome_extension/desktop_capture.dart
(API reference)package:chrome_extension/devtools_inspected_window.dart
(API reference)package:chrome_extension/devtools_network.dart
(API reference)package:chrome_extension/devtools_panels.dart
(API reference)package:chrome_extension/devtools_recorder.dart
(API reference)package:chrome_extension/document_scan.dart
(API reference)package:chrome_extension/dom.dart
(API reference)package:chrome_extension/downloads.dart
(API reference)package:chrome_extension/enterprise_device_attributes.dart
(API reference)package:chrome_extension/enterprise_hardware_platform.dart
(API reference)package:chrome_extension/enterprise_networking_attributes.dart
(API reference)package:chrome_extension/enterprise_platform_keys.dart
(API reference)package:chrome_extension/events.dart
(API reference)package:chrome_extension/extension.dart
(API reference)package:chrome_extension/extension_types.dart
(API reference)package:chrome_extension/file_browser_handler.dart
(API reference)package:chrome_extension/file_system_provider.dart
(API reference)package:chrome_extension/font_settings.dart
(API reference)package:chrome_extension/gcm.dart
(API reference)package:chrome_extension/history.dart
(API reference)package:chrome_extension/i18n.dart
(API reference)package:chrome_extension/identity.dart
(API reference)package:chrome_extension/idle.dart
(API reference)package:chrome_extension/input_ime.dart
(API reference)package:chrome_extension/instance_id.dart
(API reference)package:chrome_extension/login_state.dart
(API reference)package:chrome_extension/management.dart
(API reference)package:chrome_extension/notifications.dart
(API reference)package:chrome_extension/offscreen.dart
(API reference)package:chrome_extension/omnibox.dart
(API reference)package:chrome_extension/page_action.dart
(API reference)package:chrome_extension/page_capture.dart
(API reference)package:chrome_extension/permissions.dart
(API reference)package:chrome_extension/platform_keys.dart
(API reference)package:chrome_extension/power.dart
(API reference)package:chrome_extension/printer_provider.dart
(API reference)package:chrome_extension/printing.dart
(API reference)package:chrome_extension/printing_metrics.dart
(API reference)package:chrome_extension/privacy.dart
(API reference)package:chrome_extension/processes.dart
(API reference)package:chrome_extension/proxy.dart
(API reference)package:chrome_extension/runtime.dart
(API reference)package:chrome_extension/scripting.dart
(API reference)package:chrome_extension/search.dart
(API reference)package:chrome_extension/sessions.dart
(API reference)package:chrome_extension/side_panel.dart
(API reference)package:chrome_extension/storage.dart
(API reference)package:chrome_extension/system_cpu.dart
(API reference)package:chrome_extension/system_display.dart
(API reference)package:chrome_extension/system_memory.dart
(API reference)package:chrome_extension/system_network.dart
(API reference)package:chrome_extension/system_storage.dart
(API reference)package:chrome_extension/tab_capture.dart
(API reference)package:chrome_extension/tab_groups.dart
(API reference)package:chrome_extension/tabs.dart
(API reference)package:chrome_extension/top_sites.dart
(API reference)package:chrome_extension/tts.dart
(API reference)package:chrome_extension/tts_engine.dart
(API reference)package:chrome_extension/types.dart
(API reference)package:chrome_extension/vpn_provider.dart
(API reference)package:chrome_extension/wallpaper.dart
(API reference)package:chrome_extension/web_authentication_proxy.dart
(API reference)package:chrome_extension/web_navigation.dart
(API reference)package:chrome_extension/web_request.dart
(API reference)package:chrome_extension/windows.dart
(API reference)package:chrome_extension/usb.dart
(API reference)