-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: also dynamically adjust URL in settings page
- Loading branch information
Showing
4 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Helper functions useful for ensuring browser compatibility. | ||
* | ||
* @public | ||
* @module BrowserCompat | ||
*/ | ||
|
||
/** | ||
* Returns a value based on what browser this is running in. | ||
* | ||
* @private | ||
* @param {Object} switchBrowser an object with values to return per browser | ||
* @returns {string} | ||
*/ | ||
export async function getBrowserValue(switchBrowser) { | ||
if (browser.runtime.getBrowserInfo) { | ||
const browserInfo = await browser.runtime.getBrowserInfo(); | ||
|
||
if (browserInfo.name === "Thunderbird") { | ||
return switchBrowser.thunderbird; | ||
} else { | ||
return switchBrowser.firefox; | ||
} | ||
} else { | ||
return switchBrowser.chrome; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters