警报在打包的应用程序中不起作用 [英] alert doesn't work in packaged apps

查看:104
本文介绍了警报在打包的应用程序中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在学习chrome的打包应用程序中的webview,并且正在研究Chrome中的浏览器示例。
在onload函数中的browser.js文件中,我添加了alert(webview apps);在第一行,代码不再工作,当我删除这一行时,它再次工作。


I'm studying webview in packaged apps of chrome and I'm studying browser sample from chrome. in browser.js file in onload function, I added alert("webview apps"); at the first row and the code didn't work anymore, when I deleted this row, it worked again.

onload = function() {
    alert("webview app");
    var webview = document.querySelector('webview');
    doLayout();
    ...
}

应用?

P / s:console.log也不起作用,我看到源代码使用它,但没有在检查元素窗口中显示


so does alert work on packaged apps?
P/s: console.log also doesn't work, I saw the source code use it, but nothing is displayed on inspect element window

推荐答案

Console.log 应该正常工作,这一切都取决于您正在查看的视图。例如,要在窗口中访问日志,您必须在页面上检查元素才能看到它。

Console.log should work, it all depends on what view you are looking at. For example to get to the logs when in a window, you have to "Inspect Element" on the page to get to it.

警报具有已被禁用以及确认和其他一些旧功能。

Alert has been disabled along with confirm and a number of other legacy web features.

这篇关于警报在打包的应用程序中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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