package ezjs_extension
Binding for Chrome and Firefox extension API
Install
Dune Dependency
Authors
Maintainers
Sources
0.1.tar.gz
md5=0d1dc7175a620eb50c07f2bbe0531533
sha512=5742b4e64398533c95291fe7c9b5ed3e264214dee7522fec1a0074766afd40e633aa1ceea16cbc6923ab80d737a15c13b50b96d4ddf8fad8ec74c30816877c9a
doc/src/ezjs_extension.chrome/browser_action_chrome.ml.html
Source file browser_action_chrome.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
open Ezjs_min include Chrome_common.Browser_action let set_title ?id ?title ?callback () = let details : titleDetails t = Unsafe.obj [||] in details##.title := opt string title; details##.tabId := Optdef.option id; browserAction##setTitle details (optdef wrap_callback callback) let get_title ?id f = let details : tabDetails t = Unsafe.obj [||] in details##.tabId := Optdef.option id; browserAction##getTitle details (wrap_callback (fun s -> f (to_string s))) let set_icon ?data ?path ?id ?callback () = let details : iconDetails t = Unsafe.obj [||] in (match path, data with | Some s, _ -> details##.path := def (string s) | _, Some d -> details##.imageData := def d | _ -> ()); details##.tabId := Optdef.option id; browserAction##setIcon details (optdef wrap_callback callback) let set_popup ?id ?popup ?callback () = let details : popupDetails t = Unsafe.obj [||] in details##.popup := opt string popup; details##.tabId := Optdef.option id; browserAction##setPopup details (optdef wrap_callback callback) let get_popup ?id f = let details : tabDetails t = Unsafe.obj [||] in details##.tabId := Optdef.option id; browserAction##getPopup details (wrap_callback (fun s -> f (to_string s))) let set_badge ?id ?text ?callback () = let details : badgeDetails t = Unsafe.obj [||] in details##.text := opt string text; details##.tabId := Optdef.option id; browserAction##setBadgeText details (optdef wrap_callback callback) let get_badge ?id f = let details : tabDetails t = Unsafe.obj [||] in details##.tabId := Optdef.option id; browserAction##getBadgeText details (wrap_callback (fun s -> f (to_string s))) let set_badge_bg ?id ?color ?callback () = let details : badgeColorDetails t = Unsafe.obj [||] in details##.color := opt string color; details##.tabId := Optdef.option id; browserAction##setBadgeBackgroundColor details (optdef wrap_callback callback) let get_badge_bg ?id f = let details : tabDetails t = Unsafe.obj [||] in details##.tabId := Optdef.option id; browserAction##getBadgeBackgroundColor details (wrap_callback f) let enable ?id ?callback () = browserAction##enable (Optdef.option id) (optdef wrap_callback callback) let disable ?id ?callback () = browserAction##disable (Optdef.option id) (optdef wrap_callback callback)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>