I made a uploader that allows drag and drop but because people usually browse with their browsers taking up most of the screen I would like to make the browser smaller when a user clicks a button so its easier for him/her to drag the files in…
Is there a way to resize a browser window thats already open…
or at least to minimize the browser in js??
I know there is window.resizeTo(w,h);
but it doesnt work for me
Update
can users choose to unblock this functionality for a specific website??
and is there a way for me to check if a user allows or blocks that option?
Will i still be able to use window.resizeTo(w,h); is i make a new window pop up ??
Because if i am i will try defaulting to that.
If its possible to allow resizeTo(w,h); for a specific website (i mean by user settings or editing some files on the computer not by js even if it only works for some browsers ) how do you do that??
(even if its really difficult i would like to know)
Similar Question (with an answer how to do it in chrome):
set_browser_window_size
Another One (this one explains how you can check about:config values with js)
check about:config with js
It be nice to see a list of browsers that support the resizeTo function with the version number.
Almost all new browsers disable this event by default for the reason of annoying users and malicious actions.
At some browsers users allowed to enable this action manually, but ~95% of users will have default settings. To enable resizing at Firefox you can go to
about:configand setdom.disable_window_move_resize;trueattribute tofalseYou can try to resize user window at any time with
window.resizeTo(w,h);method and then check current user screen height. ie with jQuery methodvar curH =$(window).innerHeight();and comperehwithcurHto be sure that its resized.The better way to solve your problem is to allow users to drag files from the folder to the specific area of the screen or open dialog on action with multiple files selection.
Addons
Maybe the best choose will be to organize uploading at your website with own addon for most of popular browsers. You can write your own for Chrome, Opera and Firefox.
Advantages: