web_extensions_sys/
action.rs

1use crate::EventTarget;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen]
5extern "C" {
6    // https://developer.chrome.com/docs/extensions/reference/action/
7    pub type Action;
8
9    // https://developer.chrome.com/docs/extensions/reference/action/#event-onClicked
10    #[wasm_bindgen(method, getter, js_name = onClicked)]
11    pub fn on_clicked(this: &Action) -> EventTarget;
12
13    // https://developer.chrome.com/docs/extensions/reference/action/#method-openPopup
14    #[wasm_bindgen(catch, method, js_name = openPopup)]
15    pub async fn open_popup(this: &Action, options: &JsValue) -> Result<JsValue, JsValue>;
16}