Overriding useragent header affects JavaScript too - intentional?

I am the maintainer for the Firefox version of https://addons.mozilla.org/firefox/addon/random_user_agent/. The extension was originally developed by someone else for Chrome and I merely ported it to Firefox (well, “ported”. Thankfully there were only a few tweaks necessary for Firefox to accept it :slight_smile: ).
The extension principally overrides the respective header for the user agent in requests. Additionally it also provides a configurable option to inject a JavaScript snippet with the purpose of overriding navigator.userAgent.

During the analysis of a recent bug report I discovered that Firefox apparently behaves very differently from Chrome in this regard. While Chrome treats the HTTP header and the JavaScript world completely separately Firefox seems to automagically apply the value of the header in the request to the navigator object in the subsequent page context.

Is this known? Is this intentional?

Thanks in advance.