crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

InstallTrigger to detect Firefox is deprecated #690

Open BenTen opened 1 year ago

BenTen commented 1 year ago

To detect Firefox, Print.js use InstallTrigger but it's deprecated.

Here https://bugzilla.mozilla.org/show_bug.cgi?id=1754441#c30 Dennis Schubert said

If no feature detection is possible, I agree that this is a bit of a bad spot to be in. In those cases, running the simplest user-agent based test, something like const isFirefox = /firefox/i.test(navigator.userAgent); is probably the best way here.

Relying on Firefox-only properties to detect the browser itself might look like an easier solution, but unfortunately it has the potential of breaking down the line - or it can force the browser developers to keep a non-standard property around just for compatibility reasons, which also isn't great.