Start my chrome app fullscreen

0

I'm studying chrome api to create extensions, I've downloaded an example and I'm modifying it. I want my extension to start fullscreen, I made several changes but none worked. I gave permission on the manifest and nothing. Here is my code below:

chrome.app.runtime.onLaunched.addListener(function() {
  // Center window on screen.
  var screenWidth = screen.availWidth;
  var screenHeight = screen.availHeight;
  var width = 500;
  var height = 300;

  chrome.app.window.create('index.html', {
    id: "helloWorldID",
    outerBounds: {
      width: width,
      height: height,
      left: Math.round((screenWidth-width)/2),
      top: Math.round((screenHeight-height)/2)
    }
  });

});
    
asked by anonymous 29.08.2017 / 16:37

2 answers

0
chrome.windows.update(windowId, { state: "fullscreen" })

See: link

    
29.08.2017 / 19:25
0

What worked for me was to create an external javascript file with the following code:

setTimeout(chrome.app.window.current().fullscreen,0);
    
29.08.2017 / 19:39