Reputation: 8880
Is there a Javascript or jQuery method to minimize the current browser window?
Upvotes: 11
Views: 37742
Reputation: 99
If you use an extension, then you can minimize by chrome.windows.update(window.id, { state: 'minimized' })
Upvotes: 3
Reputation: 211
I hope this is what you are looking for:
<SCRIPT LANGUAGE="JavaScript">
function Minimize()
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;
}
function Maximize()
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</SCRIPT>
<A HREF="javascript:onClick=Minimize()">Minimize</A>
<A HREF="javascript:onClick=Maximize()">Maximize</A>
Upvotes: -9
Reputation: 69981
There is no way to minimize the browser window within javascript.
There are ways to change the size of the window, but no true minimization (nice word)
Upvotes: 17
Reputation: 12450
No, there isn't. However, depending on what you're doing and which browsers you're targeting, you could play around with the blur and focus events of the window to achieve similar effect.
Upvotes: 5