A shim to insulate apps from WebRTC spec changes and browser prefix differences
Overall
score
98%
A utility library that detects browser information from user agent strings and provides structured browser details.
@generates
/**
* Returns structured information about the current browser.
*
* @returns {Object} An object containing:
* - browser: A string identifying the browser type (e.g., 'chrome', 'firefox', 'safari')
* - version: A number representing the major version of the browser
*/
function getBrowserDetails() {
// IMPLEMENTATION HERE
}
/**
* Extracts a version number from a user agent string using a regular expression.
*
* @param {string} uastring - The user agent string to parse
* @param {string} expr - The regular expression pattern to match the version
* @param {number} pos - The position in the regex match array to extract (typically 1 or 2)
* @returns {number|null} The extracted version number, or null if not found
*/
function extractVersion(uastring, expr, pos) {
// IMPLEMENTATION HERE
}
module.exports = {
getBrowserDetails,
extractVersion,
};Provides browser detection and version extraction utilities for WebRTC compatibility.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-webrtc-adapterdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10