Skip to content

Commit

Permalink
Fix caml_js_on_ie
Browse files Browse the repository at this point in the history
Recent versions of node define `navigator` but not `navigator.userAgent`.
  • Loading branch information
vouillon committed Jul 25, 2023
1 parent 0df7260 commit 9288bb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Runtime: fix Gc.stat, Gc.quick_stat, Gc.get (#1475)
* Compiler: fix some miscompilation, probably introduced in jsoo 5.0.0,
revealed by OCaml 5.0
* Runtime: fix Dom_html.onIE (#1493)

# 5.3.0 (2023-06-21) - Lille
## Features/Changes
Expand Down
3 changes: 2 additions & 1 deletion runtime/jslib_js_of_ocaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
//Provides: caml_js_on_ie const
function caml_js_on_ie () {
var ua =
globalThis.navigator?globalThis.navigator.userAgent:"";
(globalThis.navigator&&globalThis.navigator.userAgent)
?globalThis.navigator.userAgent:"";
return ua.indexOf("MSIE") != -1 && ua.indexOf("Opera") != 0;
}

Expand Down

0 comments on commit 9288bb1

Please sign in to comment.