Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Getting an error "navigator.getBattery" when embed youtube video #10003

Closed
alokpant opened this issue Jul 16, 2017 · 5 comments
Closed

Getting an error "navigator.getBattery" when embed youtube video #10003

alokpant opened this issue Jul 16, 2017 · 5 comments

Comments

@alokpant
Copy link

When youtube videos are embed in the page, it gives error:

Uncaught (in promise) Error: navigator.getBattery not supported.
    at Promise (chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/content/scripts/navigator.js:12)
    at Promise (<anonymous>)
    at Navigator.getBattery (chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/content/scripts/navigator.js:12)

Multiple videos give same multiple errors:
screen shot 2017-07-16 at 12 52 44

Even after putting shield down it gives same error:
screen shot 2017-07-16 at 12 54 20

Not able to reproduce on:
Chrome 'Version 59.0.3071.115 (Official Build) (64-bit)'
Firefox 52.0.2 (64-bit)
Safari Version 10.1.1 (12603.2.4)

Current version of Brave | 0.17.13
Operating System: macOS Sierra 10.12.5

Video can be reproduced by inspecting the page at:
https://codepen.io/gorkhali/pen/NgmRBR

I am trying to debug my own script and because of navigator.getBattery, all debuggers are skipped.

Thank you very much.

@cndouglas
Copy link

For privacy reasons, navigator.getBattery is not available in Brave. (Issue #1885, commit 7e3d749) It is also not available in Firefox or WebKit-based browsers, but only Chromium-based browsers.

YouTube probably assumes Brave supports navigator.getBattery since it's Chromium-based. Not sure how to work around that.

@luixxiul
Copy link
Contributor

wontfix? @diracdeltas

@alokpant
Copy link
Author

Honestly I do not have any use-case for 'navigator.getBattery'. I just embedded 3 videos. However the impact of this error message was that my debugger on console was getting skipped. So it was difficult for me to test feature. I used chrome for all additional testing as there was no error there.

Please feel free to close it.

@cndouglas
Copy link

I wonder if we could temporarily spoof navigator.getBattery just for YouTube until the API is removed in Chromium.

@diracdeltas
Copy link
Member

thanks, closing as wontfix since all major browsers are removing support for this API or have already done so

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants