package jext

  1. Overview
  2. Docs
Js_of_ocaml tools to help handling web extension

Install

Dune Dependency

Authors

Maintainers

Sources

jext-0.1.0.tar.gz
md5=fed8296cfc592824344f21fb4185cf29
sha512=b1cbd394782aaa7a24baf1d8f17d0e6076b5fb209f1467123a3a609975a8906ec55de02a1c6ccc5841c7f1fda5ce506004b161242ba16263f19cc44c007b26a4

doc/src/jext.lwt/utils_lwt.ml.html

Source file utils_lwt.ml

1
2
3
4
5
6
7
8
9
10
11
open Chrome_lwt
open Common

module Make(S : Types.S) = struct
  let popup ?(base="notification.html") ?(width=300) ?(height=600) ?id ?(callback : (Windows.window Ezjs_min.t -> unit) option) request =
    let id = Option.fold ~none:"" ~some:(fun i -> Format.sprintf "&id=%d" i) id in
    let req = encode ((fst S.request_jsoo_conv) request) in
    let url = Format.sprintf "%s?req=%s%s" base req id in
    let info = Windows.make_createData ~url ~typ:"popup" ~width ~height () in
    Lwt.map (fun _ -> ()) (Windows.create ?callback ~info ())
end
OCaml

Innovation. Community. Security.