How to access Ambient Light Sensor in Chrome Web browser? - google-chrome

I am working on a Light Meter browser-based app. I want to measure the Ambient light in Lumens and display the same on the browser. I found there is a Google Sensors for Web API however, its not supported anymore? Can someone explain how to Access the Ambient Light sensor using a browser?
https://developers.google.com/web/updates/2017/09/sensors-for-the-web
This flag in chrome enables the same. chrome://flags/#enable-generic-sensor-extra-classes However, this requires a Browser re-launch. Any method that I can get a user to enable this without browser re-launch?

Related

PWA behaviour in the background mode

Our project includes a personal account, which works via chrome.
There is a special mechanism in Google Chrome to mitigate the negative effect on the background tabs (https://developers.google.com/web/updates/2017/03/background_tabs).
Nevertheless, for the purposes of our app, we need to disable this function for our app. Disabling via flags is not possible due to several reasons.
As far as we understand, we can solve this problem via PWA (Progressive Web Application). However, we cannot find any references of how PWA behaves in the background mode.
So please provide information - whether there are any restrictions on PWA in the background or the application is always "active"?

dotnetbrowser with earth plugin too slow

i am testing dotnetbrowser from teamdev.com within an wpf application.
when i call google maps 3d functionality like this:
https://www.google.com/maps/#50.052475,8.7434217,109a,20y,41.07h,76.14t/data=!3m1!1e3
the viewer works but is very slow. takes 5x the time as in google chrome on the same machine.
the code is the same as in simple example on teamdev homepage.
any tipps?
gl
teenriot
You can try to use Heavyweight browser mode:
Browser browser = BrowserFactory.Create(BrowserType.HEAVYWEIGHT);
If the problem persists, please contact our support via email address, provided to you in the evaluation email.

How can I cast an HTML page with the Google Cast Chrome extension?

I'm building a simple web application that I want to be able to display on a TV screen using the Google Cast SDK, the Chrome browser and a Chromecast. I know with the Chromecast extension for Chrome Browser, I can cast a tab to a Chromecast device, which, from my laptop works perfectly. However, I want this exact same functionality, but available from iOS devices (iPads and iPhones) running the Chrome Browser.
It seems since Chrome v36 the Cast ability is baked into the iOS versions of Chrome. I have pulled in the Google Cast SDK per these instructions: https://developers.google.com/cast/docs/chrome_sender. I am able to get my iPad to connect to the Chromecast, but when I try to pass in a URL to a web page...
var mediaInfo = new chrome.cast.media.MediaInfo('http://google.com');
var request = new chrome.cast.media.LoadRequest(mediaInfo);
session.loadMedia(request, onMediaDiscovered.bind(this, 'loadMedia'), onMediaError);
I get an error...
invalid_parameter
I have found other, somewhat dated examples, saying I can build a custom Cast Receiver that holds an iFrame and renders the page in there, but I do not want to build a custom Cast Receiver.
Can I accomplish this with just a Cast Sender?
You always need a receiver on the chromecast; that is what gets loaded there. In general, you can either use a default/styled receiver or a custom one. The Default or Styled receivers can only handle media so you are left with the Custom option and having an iframe is the way to go.
Chrome on iOS doesn't support casting. There's a post from early 2016 saying this on the google product forums. (But my reputation is too low to post more than two links).
If it DID work, then all you would need to do is go to this site and choose the ChromeCast option and press Launch after typing in your website. This does work on Chrome on desktop.
The source for this sender/receiver is here: https://github.com/boombatower/chromecast-dashboard
I've used the boombatower.github.io receiver with my own code as sender in an iOS app. I'm also looking at whether an app extension would work, but I suspect not because of app extension limitations.

Does Google Chrome Frame break IE8 console output?

This is a question about debugging a project, not about writing the code.
I am on the final stages of developing an HTML5 web app. Fairly last minute, our client tells us it should run on IE8. Since I use the HTML5-canvas in the app, this required the addition of Google Chrome Frame. Once installed and testing, however, IE8's developer console no longer prints any data, and the HTML viewer never loads. Is this a bug? Is there a way to fix it? It will really suck if I need to debug with alerts...
From Google Chrome Frame documentation:
You can use the Web Inspector in GCF just as you would in the Google Chrome browser. To use it, right-click and choose "Inspect Element". Logging is available via the console.log method, and you can set breakpoints and inspect network activity.

How does Chrome get device orientation information?

I was reading about Chrome being able to get device orientation information (Engadget article, WebKit Bugzilla archive). Some questions:
Is there a demo HTML5 page that shows off the use of this device orientation info? What platforms does it work on?
Is this device orientation info available on other WebKit browsers like Safari?
How does Chrome get this information on different platforms? Does it make system calls? Where in the code branch is this done? If I want to help provide this device orientation on a new device/OS/platform, how can I contribute?
Here's Google's HTML5 SlideOrientation demo
Also, MacBooks do have a type of accelerometer, called a Sudden Motion Sensor. It's purpose is to prevent hard drive damage by protecting the hard drive in the event of sudden acceleration.
http://web.me.com/avidrissman/deviceorientation.html, it's only available on OS X.
It's available on iOS, but not in desktop Safari
It reads the accelerometer. It's done in this file. See the how to contribute to chromium guide on how to contribute patches in general.