From d0a20d2d4b5515ea023bdb9d6bcfd4f242c89848 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Tue, 25 May 2021 23:57:02 +1000 Subject: [PATCH] navigator.getBattery() is not deprecated (#5227) * navigator.getBattery() is not deprecated * Update files/en-us/web/api/navigator/index.html Co-authored-by: Joe Medley * Fix fixable flaw link Co-authored-by: Joe Medley --- .../web/api/navigator/getbattery/index.html | 20 +++++++++---------- files/en-us/web/api/navigator/index.html | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/files/en-us/web/api/navigator/getbattery/index.html b/files/en-us/web/api/navigator/getbattery/index.html index 50a8c4fd521dd97..6f6032a41a7ba89 100644 --- a/files/en-us/web/api/navigator/getbattery/index.html +++ b/files/en-us/web/api/navigator/getbattery/index.html @@ -2,21 +2,21 @@ title: Navigator.getBattery() slug: Web/API/Navigator/getBattery tags: -- API -- Battery API -- Device API -- Method -- Navigator -- Reference -- getBattery + - API + - Battery API + - Device API + - Method + - Navigator + - Reference + - getBattery --- -
{{ ApiRef("Battery API") }}{{deprecated_header}}
+
{{ ApiRef("Battery API") }}

The getBattery() method provides information about the system's battery. It returns a battery promise, which is resolved in a {{domxref("BatteryManager")}} object providing also some new events you can handle to monitor the battery status. This implements the Battery Status API; see that + href="/en-US/docs/Web/API/Battery_Status_API">Battery Status API; see that documentation for additional details, a guide to using the API, and sample code.

@@ -103,7 +103,7 @@

Browser compatibility

See also

diff --git a/files/en-us/web/api/navigator/index.html b/files/en-us/web/api/navigator/index.html index c27dcc0901c4493..ff978d186a2b7d7 100644 --- a/files/en-us/web/api/navigator/index.html +++ b/files/en-us/web/api/navigator/index.html @@ -134,6 +134,8 @@

Methods

Returns true if a call to Navigator.share() would succeed.
{{domxref("Navigator.clearAppBadge()")}}
Clears a badge on the current app's icon and returns a {{jsxref("Promise")}} that resolves with {{jsxref("undefined")}}.
+
{{domxref("Navigator.getBattery()")}}
+
Returns a promise that resolves with a {{domxref("BatteryManager")}} object that returns information about the battery charging status.
{{domxref("Navigator.registerProtocolHandler()")}}
Allows web sites to register themselves as a possible handler for a given protocol.
{{domxref("Navigator.requestMediaKeySystemAccess()")}}