Skip to content

Commit

Permalink
Fix caml_js_on_ie (#1493)
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 authored Jul 26, 2023
1 parent 0df7260 commit 8cd97dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Dev (2023-??-??) - ??

* Runtime: fix Dom_html.onIE (#1493)

# 5.4.0 (2023-07-06) - Lille

## Bug fixes
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 8cd97dc

Please sign in to comment.