Firefox extensions can, and have always could. ChatZilla, for example, does direct access to IRC servers from Mozilla browsers since 2000, but even server sockets are possible[1]. Native components are also possible - they're called XPCOM components. Or you can use js-ctypes[2].
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/...
[2] https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes