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-lwt/runtime_chrome_lwt.ml.html
Source file runtime_chrome_lwt.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
open Ezjs_min_lwt open Promise include Chrome_common.Runtime let getBackgroundPage () = to_lwt_cb (fun cb -> runtime##getBackgroundPage cb) let openOptionsPage ?callback () = to_lwt_cb_opt callback (fun cb -> runtime##openOptionsPage cb) let setUninstallURL ?callback s = to_lwt_cb_opt callback (fun cb -> runtime##setUninstallURL s cb) let requestUpdateCheck () = to_lwt_cb (fun cb -> runtime##requestUpdateCheck cb) let restartAfterDelay ?callback i = to_lwt_cb_opt callback (fun cb -> runtime##restartAfterDelay i cb) let sendMessage ?id ?options ?callback message = match callback with | Some callback -> let waiter, notifier = Lwt.wait () in runtime##sendMessage (Optdef.option id) message (Optdef.option options) (def (Lwt.wakeup notifier)); waiter >>= fun x -> return (Some (callback x)) | None -> runtime##sendMessage (Optdef.option id) message (Optdef.option options) undefined; Lwt.return_none let sendNativeMessage ?callback application message = match callback with | Some callback -> let waiter, notifier = Lwt.wait () in runtime##sendNativeMessage (string application) message (def (Lwt.wakeup notifier)); waiter >>= fun x -> return (Some (callback x)) | None -> runtime##sendNativeMessage (string application) message undefined; Lwt.return_none let getPlatformInfo () = to_lwt_cb_tr Extension_utils.Runtime.to_platform_info (fun cb -> runtime##getPlatformInfo cb) let getPackageDirectoryEntry () = to_lwt_cb (fun cb -> runtime##getPackageDirectoryEntry cb)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>