8

I am trying to make chrome extension to be in full screen, but the max I can do is half width. More then that it just give me a scroll bar in the bottom.. How can I make it to be in full screen? meaning, the whole width of the chrome browser? Thanks!

EliK
  • 137
  • 1
  • 2
  • 4
  • 1
    You're talking about a Browser Action popup window? I'm not sure those are able to be full-width windows. Try the Fullscreen API, but even that might not be possible. You may want to open a new tab with your extension's content instead. – Jason Hall Jun 26 '12 at 15:27
  • You should accept Vincent Scheib's answer at the bottom. It is the correct, current, and "fully operational" answer. – temporary_user_name Sep 24 '13 at 04:53

5 Answers5

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

See http://developer.chrome.com/extensions/windows.html#method-update

Vincent Scheib
  • 13,630
  • 7
  • 56
  • 74
2

In your extensions "background.js" script:

chrome.app.runtime.onLaunched.addListener(function (launchData) {
  chrome.app.window.create(
    // Url
    '/editor.html',
    // CreateWindowOptions
    {
            'width': 400,
            'height': 500
    },
    // Callback
    function(win) {
        win.contentWindow.launchData = launchData;
        win.maximize();
        win.show();
    });
});
Andrew Mackenzie
  • 5,005
  • 4
  • 42
  • 61
  • It requires 'app.window' permission, but: "'app.window' is only allowed for packaged apps, and this is a extension." – danieleds Sep 10 '13 at 19:28
1

Did you try the fullScreen API ?

Calvein
  • 2,030
  • 11
  • 23
1
addEventListener("click", function() {
    var
          el = document.documentElement
        , rfs =
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
    ;
    rfs.call(el);
});

As seen in this post

Community
  • 1
  • 1
John Riselvato
  • 12,403
  • 5
  • 58
  • 87
0

for general use on web pages in all browsers, include msRequestFullscreen

addEventListener("click", function () {
    var
          el = document.documentElement
        , rfs =
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
            || el.msRequestFullscreen
    ;
    if (rfs) { rfs.call(el); } else { console.log('fullscreen api not supported');}
});
Rob Parsons
  • 831
  • 6
  • 4