Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a chrome packaged app which runs in fullscreen at startup?

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?

like image 758
Wouter Schut Avatar asked Mar 16 '13 16:03

Wouter Schut


1 Answers

main.js

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

manifest.json

{
  ...
  "manifest_version": 2,
  "minimum_chrome_version": "23",
  "app": {
    "background": {
      "scripts": ["main.js"]
    }
  },
  "permissions": ["fullscreen"]
}
like image 195
asissuthar Avatar answered Sep 21 '22 13:09

asissuthar