eatskolnikov / CurrentBrowser

Multiplatform way of getting the current browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Current Browser

Multiplatform way of getting the current browser.

Example

Normally you would have something like this for Chrome

chrome.runtime.onInstalled.addListener(function(){
//something here
}); 

And this for Firefox

browser.runtime.onInstalled.addListener(function(){
//something here
}); 

You can replace them with

CurrentBrowser().runtime.onInstalled.addListener(function(){
//something here
}); 

And now you can work for both browsers with a single codebase.

About

Multiplatform way of getting the current browser.

License:MIT License


Languages

Language:JavaScript 100.0%