Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium Closure UserAgent

From Leeroopedia
Revision as of 11:50, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/SeleniumHQ_Selenium_Closure_UserAgent.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains JavaScript_Atoms, Vendored_Library
Last Updated 2026-02-12 00:00 GMT

Overview

Vendored Google Closure Library module providing rendering engine and browser detection via user agent string parsing.

Description

Rendering engine detection utilities. Exposes compile-time constants and runtime checks for browser engines (IE, Edge/EdgeHTML, Gecko, WebKit, Opera/Presto) and platforms (mobile). Supports compile-time assumptions (ASSUME_IE, ASSUME_GECKO, etc.) for dead-code elimination by the Closure Compiler. For browser brand detection (Safari vs Chrome), see goog.userAgent.product.

Usage

Consumed internally by Selenium's JavaScript atoms build system.

Code Reference

Source Location

Key Exports

goog.provide('goog.userAgent');

// Compile-time assumption flags
goog.userAgent.ASSUME_IE
goog.userAgent.ASSUME_EDGE
goog.userAgent.ASSUME_GECKO
goog.userAgent.ASSUME_WEBKIT
goog.userAgent.ASSUME_MOBILE_WEBKIT
goog.userAgent.ASSUME_OPERA

// Runtime detection constants
goog.userAgent.OPERA     // Presto-based Opera
goog.userAgent.IE        // Internet Explorer
goog.userAgent.EDGE      // EdgeHTML-based Edge
goog.userAgent.EDGE_OR_IE
goog.userAgent.GECKO     // Firefox/Gecko engine
goog.userAgent.WEBKIT    // WebKit engine
goog.userAgent.MOBILE    // Mobile browser
goog.userAgent.SAFARI    // Alias for WEBKIT

// Functions
goog.userAgent.getUserAgentString = function() { ... };
goog.userAgent.getNavigator = function() { ... };

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment