Reputation: 170713
I want to show some text on the option page which depends on whether my extension is running in Firefox or Chrome (namely, a warning that there is a relevant bug in Firefox and which version it's fixed in). What is the best way to test for it?
Upvotes: 1
Views: 270
Reputation: 293
This is how I check.
// Hide option for Chrome
let isFirefox = navigator.userAgent.indexOf('Firefox') !== -1;
if (!isFirefox) {
document.getElementById('CP_l').style.display = "none";
}
Upvotes: 2