如何制作在启动时全屏运行的chrome打包应用程序? [英] How can I make a chrome packaged app which runs in fullscreen at startup?

查看:79
本文介绍了如何制作在启动时全屏运行的chrome打包应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前看来,全屏功能只能通过用户操作(鼠标/键盘事件)来激活.有办法避免这种情况吗?

Currently it seems that the fullscreen ability can only be activated from a user action (mouse/keyboard event). Is there a way to circumvent this?

推荐答案

现在,您可以在主.js上添加state:"fullscreen"属性:

Now, you can just add the state:"fullscreen" property on your main .js:

chrome.app.runtime.onLaunched.addListener(
    function() {
        chrome.app.window.create('index.html',
            {
                state: "fullscreen",
            }
        );
    }
);

确保不添加resizable: falsebounds属性,并在manifest.json上添加"fullscreen"权限.

Make sure you don't add resizable: false or bounds properties, and you add a "fullscreen" permision on the manifest.json.

{
    ...
    "permissions": [
        ...
        "fullscreen"
    ]
}

这篇关于如何制作在启动时全屏运行的chrome打包应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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