Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>NavigatorLanguage: the most preferred language is the one returned by navigator.language</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_true("language" in navigator);
assert_true("languages" in navigator);
assert_equals(navigator.languages[0], navigator.language,
"navigator.languages is the most preferred language first");
});
</script>