privacy.resistFingerprinting = true causes extension popup to think it's mobile

Touch or being able to hover things relate to how the user interacts with your site, while the full screensize is only relevant in very few cases (like picking the best wallpaper resolution for you).

resistFingerprinting is a trade-off the user opts into that gives them more privacy in turn of a potentially reduced experience, like websites not rendering properly or assuming the wrong things about their system.

The difference with that workaround is, that your touchscreen specific styling would only be applied when the user is willing to share that device detail with you, instead of relying on the user sharing his screen size with you, which makes no sense in relation to touch screens.

That was concerning the idea that max-width etc. were reacting based on the full screen size instead of the viewport, which you later confirmed was not the case.

Yes, mostly. However a user specifically choosing not to report you the correct value is not something you should be trying to work around. Unless you don’t believe in their choice. So no need for hacks. My suggestion was merely to remove your hack for touchscreen detection.

I assume you’re also referring to -moz-touch-enabled here. Since you are an extension I do think a certain degree of browser-specifc code is ok, even more so than on the web (where we have luckily mostly moved to feature detection). Even if the extension APIs are mostly compatible you will still end up writing some browser-specific code.

You could also do it like other websites and ignore -moz-touch-enabled and just offer a more condensed view on Firefox for Android and Windows devices with touchscreens.