Creating cross browser extensions

Creating cross browser extensions

Nov 19, 2024

When creating a browser extension you probably want to publish it for every major browser.

The APIs used inside the extension to communicate with the different browsers are mostly the same but the root element used to access them may have a different name. In Firefox it's named browser, in Chrome it's named chrome and in Edge it's named msBrowser.

So you might want to use this little snippet to get the correct one ;)

image

Enjoy this post?

Buy Jan Benjamin Fiedler IT-Solutions a coffee

More from Jan Benjamin Fiedler IT-Solutions