package ezjs_extension
Binding for Chrome and Firefox extension API
Install
Dune Dependency
Authors
Maintainers
Sources
0.2.tar.gz
md5=656df77dabbefd03a5646cf72953b29c
sha512=f1e0f92683eb1605bb32ba2791ef046fd2312357f19fcc44ae06544708b789f2398666cf0adb1848e89c8f0a6f17615ac8437477cd7761f9cff5cff9969bb54d
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)"
>