fregante / webext-permission-toggle

Browser-action context menu to request permission for the current tab.
https://fregante.github.io/webext-permission-toggle/
MIT License
70 stars 5 forks source link

Support browsers other than Chrome #5

Closed notlmn closed 5 years ago

notlmn commented 5 years ago

As https://bugzilla.mozilla.org/show_bug.cgi?id=1382953 is out in FF 62(?), wouldn't it be better to convert all the Chrome specific code to a standardized one.

Like basic feature detection should be fine right

if (typeof window.chrome === 'object') {
    if (typeof window.browser === 'undefined') {
        window.browser = window.chrome;
    }
}
fregante commented 5 years ago

All browsers use window.chrome for backwards compatibility for the same reason navigator.userAgent always includes Mozilla/5.0. So no change necessary until that changes