Navigator
Overview
Navigator is a class in Aspose.HTML FOSS for Python.
Navigator provides utilities such as vibrate(), share(), and get_gamepads() to interact with the host environment.
This class declares 7 methods for Navigator objects in Python programs.
Available methods include: __init__, can_share, get_gamepads, java_enabled, send_beacon, share, vibrate.
Public members are accessible to any Python application after installing the Aspose.HTML FOSS for Python package.
Properties: app_code_name, app_name, app_version, bluetooth, clipboard, connection, and 34 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
user_agent | str | Read | Navigator user-agent string. |
platform | str | Read | Platform identifier stub — always 'Python'. |
language | str | Read | Primary language tag stub — always 'en'. |
languages | tuple[str, ...] | Read | Accepted languages sequence stub — always ('en',). |
online | bool | Read | Network-online stub — always True. |
on_line | bool | Read | Always True in headless mode. |
cookie_enabled | bool | Read | Cookie-enabled stub — always False in this headless library. |
vendor | str | Read | Browser vendor string stub — always ''. |
hardware_concurrency | int | Read | Logical CPU count stub — always 1. |
max_touch_points | int | Read | Maximum simultaneous touch points — always 0 (no touch device). |
pdf_viewer_enabled | bool | Read | Whether a built-in PDF viewer is available — always False. |
app_code_name | str | Read | Legacy browser code name — always 'Mozilla' per spec. |
app_name | str | Read | Legacy application name — always 'Netscape' per spec. |
app_version | str | Read | Legacy application version string — always '' in headless mode. |
product | str | Read | Legacy product identifier — always 'Gecko' per spec. |
vendor_sub | str | Read | Legacy vendor sub-string — always '' per spec. |
product_sub | str | Read | Legacy product sub-string — always '' per spec. |
do_not_track | None | Read | Do-not-track preference — always None (user preference not set). |
clipboard | None | Read | Always None — no Clipboard API in headless mode (WHATWG Clipboard §3). |
media_devices | None | Read | Always None — no MediaDevices in headless mode (Media Capture §2). |
storage | None | Read | Always None — no StorageManager in headless mode (Storage §5). |
geolocation | None | Read | Always None — no Geolocation API in headless mode (Geolocation §5). |
credentials | None | Read | Always None — no CredentialsContainer in headless mode (Credentials §3). |
xr | None | Read | Always None — no XRSystem in headless mode (WebXR §8). |
locks | None | Read | Always None — no LockManager in headless mode (Web Locks §4). |
bluetooth | None | Read | Always None — no Bluetooth API in headless mode (WebBluetooth §4). |
hid | None | Read | Always None — no HID API in headless mode (WebHID §3). |
usb | None | Read | Always None — no USB API in headless mode (WebUSB §3). |
serial | None | Read | Always None — no Serial API in headless mode (Web Serial §4). |
wake_lock | None | Read | Always None — no WakeLock API in headless mode (Wake Lock §4). |
connection | None | Read | Always None — no NetworkInformation API in headless mode. |
device_memory | float | Read | Device memory in GiB; returns 8.0 as headless sentinel. |
media_capabilities | None | Read | Always None — MediaCapabilities API not available in headless mode. |
permissions | None | Read | Always None — Permissions API not available in headless mode. |
service_worker | None | Read | Always None — Service Workers API not available in headless mode. |
user_activation | None | Read | Always None — User Activation API not available in headless mode. |
keyboard | None | Read | Always None — Keyboard API not available in headless mode. |
presentation | None | Read | Always None — Presentation API not available in headless mode. |
global_privacy_control | bool | Read | Always False — GPC signal not asserted in headless mode. |
webdriver | bool | Read | Always True — headless is a WebDriver-equivalent context. |
Methods
| Signature | Description |
|---|---|
__init__() | Calls init on this Navigator instance. |
java_enabled() → bool | Whether Java is enabled — always False. |
share(data: "dict | None") | Raise NotSupportedError — headless cannot share (Web Share API §2). |
can_share(data: "dict | None") → bool | Always False — headless environment has no sharing capability (Web Share API §2). |
vibrate(pattern: "int | list") → bool | Always False — no vibration hardware in headless mode (Vibration API §2). |
send_beacon(url: str, data: object) → bool | Always False — no network delivery in headless mode (Beacon API §3). |
get_gamepads() → list | Return an empty list — no gamepad hardware in headless mode. |