If the HTML element isn't available (which, by default, is `mobileNavigation ) then the JavaScript fails and throws an error
If the element isn't available, it should fallback to a default with (~715) or check the mobile agent.
E.g.
document.querySelector(selector).length ? document.querySelector(selector).offsetParent !== null : isMobileAgent()
However, as the check is for the visibility of an element which is done on width, maybe it should fallback to screen width instead?
Identified when using the JS with Playwright and not having the .mobileNavigation element
If the HTML element isn't available (which, by default, is `
mobileNavigation) then the JavaScript fails and throws an errorIf the element isn't available, it should fallback to a default with (~715) or check the mobile agent.
E.g.
However, as the check is for the visibility of an element which is done on width, maybe it should fallback to screen width instead?
Identified when using the JS with Playwright and not having the
.mobileNavigationelement