OCaml HTML5 parser/serialiser based on Python's JustHTML

async events

Changed files
+23 -4
lib
+15 -3
lib/js/dune
··· 24 (libraries htmlrw_js) 25 (js_of_ocaml 26 (javascript_files)) 27 - (modes js) 28 (modules htmlrw_js_main)) 29 30 ; Web Worker for background validation ··· 34 (libraries html5rw htmlrw_check bytesrw brr) 35 (js_of_ocaml 36 (javascript_files)) 37 - (modes js) 38 (modules htmlrw_js_worker)) 39 40 - ; Copy to nice filenames 41 (rule 42 (targets htmlrw.js) 43 (deps htmlrw_js_main.bc.js) ··· 47 (targets htmlrw-worker.js) 48 (deps htmlrw_js_worker.bc.js) 49 (action (copy %{deps} %{targets})))
··· 24 (libraries htmlrw_js) 25 (js_of_ocaml 26 (javascript_files)) 27 + (modes js wasm) 28 (modules htmlrw_js_main)) 29 30 ; Web Worker for background validation ··· 34 (libraries html5rw htmlrw_check bytesrw brr) 35 (js_of_ocaml 36 (javascript_files)) 37 + (modes js wasm) 38 (modules htmlrw_js_worker)) 39 40 + ; Copy to nice filenames (JS) 41 (rule 42 (targets htmlrw.js) 43 (deps htmlrw_js_main.bc.js) ··· 47 (targets htmlrw-worker.js) 48 (deps htmlrw_js_worker.bc.js) 49 (action (copy %{deps} %{targets}))) 50 + 51 + ; Copy to nice filenames (WASM) 52 + ; Note: requires wasm_of_ocaml-compiler to be installed 53 + (rule 54 + (targets htmlrw.wasm.js) 55 + (deps htmlrw_js_main.bc.wasm.js) 56 + (action (copy %{deps} %{targets}))) 57 + 58 + (rule 59 + (targets htmlrw-worker.wasm.js) 60 + (deps htmlrw_js_worker.bc.wasm.js) 61 + (action (copy %{deps} %{targets})))
+8 -1
lib/js/htmlrw_js.ml
··· 573 Jv.undefined 574 )); 575 576 - Jv.set Jv.global "html5rw" api
··· 573 Jv.undefined 574 )); 575 576 + Jv.set Jv.global "html5rw" api; 577 + 578 + (* Dispatch 'html5rwReady' event for async loaders (WASM) *) 579 + let document = Jv.get Jv.global "document" in 580 + let event_class = Jv.get Jv.global "CustomEvent" in 581 + let event = Jv.new' event_class [| Jv.of_string "html5rwReady" |] in 582 + ignore (Jv.call document "dispatchEvent" [| event |]); 583 + console_log "[html5rw] API ready"