电池API是不工作的铬弹出窗口 [英] Battery API is not working on chrome pop up window

查看:292
本文介绍了电池API是不工作的铬弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让镀铬电池对象弹出窗口

is there a way to get the Battery object in chrome pop up windows

我用这code创建弹出

I am using this code to create pop up

chrome.windows.create({'url': 'mypop.html', 'type': 'popup'}, function(window) {
  });

但有问题,使用这个code返回电池对象

but having problem to return the battery object using this code

var battery = navigator.webkitBattery;

当我打电话的mypop.html页面上的JavaScript文件。

when I am calling the javascript file on the mypop.html page.

难道不允许在弹出页面电池对象?铬安全问题

Is it the chrome security issue that disallow battery object on pop up page?

推荐答案

Chrome开发者主张已回复过来的SO。
结帐这个主题。

Chrome developer advocate has replied over here on SO. Checkout this thread.

<一个href=\"http://stackoverflow.com/questions/17522527/navigator-webkitbattery-not-working-in-google-chrome\">navigator.webkitBattery在谷歌C​​hrome浏览器不工作

这篇关于电池API是不工作的铬弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆