How to make chrome extension to be in full screen?

15,654

Solution 1

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

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

Solution 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();
    });
});

Solution 3

Did you try the fullScreen API ?

Solution 4

addEventListener("click", function() {
    var
          el = document.documentElement
        , rfs =
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
    ;
    rfs.call(el);
});

As seen in this post

Share:
15,654
EliK
Author by

EliK

Updated on June 21, 2022

Comments

  • EliK
    EliK almost 2 years

    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!