Start my fullscreen Chrome app

Asked

Viewed 49 times

0

I’m studying the Chrome api to create extensions, downloaded an example and I’m modifying. I want my extension to start fullscreen, I made several modifications but none worked. I gave permission in the manifest and nothing. Follow 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)
    }
  });

});

2 answers

0


0

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

setTimeout(chrome.app.window.current().fullscreen,0);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.