窗口打印方法在ipad chrome浏览器中不起作用

Nav*_*yar 8 javascript printing google-chrome ipad

我有以下代码:

<input type="button" value="Print" onclick="window.print(); return false;">
Run Code Online (Sandbox Code Playgroud)

哪个适用于所有浏览器,但它在ipad chrome浏览器中无效(不打开打印对话框).

我怎么解决这个问题?

但是如果我用chrome设置手动打印打印然后它的工作.

Pin*_*nal 1

这是一个 chrome 错误/功能。window.print可用,它可以工作,但什么也不做。尝试这个code

try {
    window.print()
}catch(e) {alert(e.message)}
Run Code Online (Sandbox Code Playgroud)

警报将不会显示。类也UIWebView可以使用UIKit Printing API

PS Chrome使用 UIWebView.