Full screen is alway maximising
The gesture for Full Screen does not toggle between normal size and full screen. After going full screen (which works!) and repeating the gesture the window does not return to its normal size but is maximised (with window title). F11 does toggle between Full Screen and normal size.
Damn, you found my little secret :) The problem is, that I don't know the previous state of the window after I've set it to fullscreen mode, so I decided to maximize it.
...just stumbled about it :-)
Just an idea: Among the window properties are state ("normal", "minimized", "maximized", "fullscreen"), top, left, width and heigth. If they are saved for a "normal" window before going fullscreen it should be possible to restore them with chrome.windows.update to the "normal" state with the saved geometry.
(https://developer.chrome.com/extensions/windows)
Yep, it basically would be enough to just store the previous state, because Firefox saves the dimensions by itself. But currently none of the actions does something like this, all of them work stateless. That's the main reason why I decided against keeping track of all the possible user windows. Of course this doesn't make sense from a user perspective, it's more a programming design decision. I'm still torn between both solutions.
Sure, keeping track of all user windows would be a lot of work. But if Firefox saves the dimensions by itself - what happens when you update an already fullscreened window not to 'maximized' but to 'normal' again?
It will always go to the last "normal windowed" state and not to the maximized one, which it may had before.
Isn't this exactly what F11 does?
So the action
Fullscreen: function () { chrome.windows.getCurrent((win) => { if (win.state === 'fullscreen') chrome.windows.update(win.id, { state: 'normal' }); else chrome.windows.update(win.id, { state: 'fullscreen' }); }); }
would do exactly what F11 does.
One would expect the fullscreen gesture to do the same as F11.
If you change your window to: Unmaximized window > maximized window > fullscreen Then your function will revert to the unmaximized window (or called normal window), but it should revert to the maximized window.
You're right. This differs from the F11 behaviour. But, I really would prefer this quirk over ending up with a lot of maximized windows ... Especially as there seems to be no gesture to go from maximized to normal (unmaximized) size.