I tried opening a new window using
window.open("lookup.htm","lookupWin", "height=400,width=500,resizable=false");
It works fine in IE, but in FF the pop up is still resizable. How can I disable this resizing in FF as well?
Read this one from mdc
Window functionality features
resizable
If this feature is set to yes, the new secondary window will be
resizable.
Note: Starting with version 1.4, Mozilla-based browsers have a window
resizing grippy at the right end of
the status bar, this ensures that
users can resize the browser window
even if the web author requested this
secondary window to be non-resizable.
In such case, the maximize/restore
icon in the window's titlebar will be
disabled and the window's borders
won't allow resizing but the window
will still be resizable via that
grippy in the status bar.
Starting with Firefox 3, secondary windows are always resizable
Bug 177838 - Make all popup windows resizable, ignoring resizable=no
Yes it doesn't work anymore. Try
<script type="text/javascript">
window.onresize = function()
{
window.resizeTo(500,500);
}
window.onclick = function()
{
window.resizeTo(500,500);
}
</script>
I don't think you can. Firefox (and some other browsers) just ignore the "resizable" setting.
you con configure dom.disable_window_open_feature.resizable to value false, in order to make window.open re sizable work.
Type about:config
Accept the warning
Search by typing resize and press enter ,
Look for dom.disable_window_open_feature.resizable
double click to change the value. false -> you can not resize the popup in firefox.
Related
I have a script that opens a chrome window like so chrome.exe --user-data-dir="%LOCALAPPDATA%\Google\Chrome\User Data\" --window-size=1280,118 --window-position=0,0 --app="file:///C:/desktop/test.html" I need to open another smaller popup window from that window but the popup always opens in the same size as its parent (1280x118). I have tested using window.open('','','resizeable, width=100,height=200') from a regular chrome window and it works as expected. It seems that window.open does not respect the width and height specified if it is launched from a window with a specified window-size. Are there any alternatives to window.open? Or does anybody know how to make this work in Chrome? Its working fine in IE but want to phase out IE for obvious reasons.
I made this work by setting window.open to a variable and then using window.resizeTo to change its size.
var myWindow=window.open('','newWin','width=200,height=100');
myWindow.resizeTo(200,300);
myWindow.moveTo(500, 100);
myWindow.focus(); ```
I'm new to JavaScripts,so probably I did something wrong. I would like to use the window.open method to open a new non resizable window with a predefined size, and no scrollbar. In my HTML5 file I used the following lines:
Credits
The window displays correctly, the size is ok, but it is resizable and there is a scrollbar. I used Chrome as default browser.
scrollbars=yes|no|1|0 Whether or not to display scroll bars. IE, Firefox & Opera only
Source: http://www.w3schools.com/jsref/met_win_open.asp
Check this SO answer:
window.open not resizable, scrollable
The values for resizable are 0, 1 , "no" and "yes", but resizable is IE only
Each user can configure their browser so that it opens a new tab instead of a new window.
I have a simple JS script including:
OpenWindow=window.open("", "newwin", "height=250, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");
FF 21.0 opens it to the full size of the browser window.
Chrome and Opera correctly open it to the specified width and height.
Is this a known bug in FF? Is there some way around it?
You need to remove the space between height and width in your third argument.
See strWindowFeatures # MDN
Update:
As Pointy says, this doesn't seem to be the case (and from some testing it certainly doesn't affect me in FF 24). However, quoting from Firefox's tab preferences and settings page:
If you have chosen to open pages in new tabs, Firefox will ignore this option and will open a new window from a link if the page author specified that the new window should have a specific size, because some pages can only be displayed correctly at a specific size.
So this must have been changed from FF 21 til now. How are you triggering the window.open? I know some browsers differentiate based on event source, meaning you get different results on triggering it in Javascript vs. from a user-initiated event.
Voila! Pointy had the answer.
I hadn't noticed that the window was opening in a new tab.
I unchecked the browser open-in-a-new-tab option, and now I get the properly-sized window.
Thank You!
I am making changes to a set of forms that are using TinyMCE 3.5.6 as the WYSIWYG editor. One of the modifications I would like to make is to allow people to edit text in a separate window, and the ability to resize said window. With the following initialization:
$(document).ready(function() {
tinyMCE.init({
theme: "advanced",
mode : "exact",
plugins : "fullscreen",
toolbar : "fullscreen",
elements : "id_notes_type_of_organization, id_mission_statement, id_goals_and_impact",
theme_advanced_buttons3_add : "fullscreen"
});
});
I get fullscreen, but not in a separate window. If I subsequently add fullscreen_new_window: true, a new window opens but:
The toolbars are missing from the new window;
The window size is tiny and requires resizing;
Any text I type into this window does not carry over to the text field that I originally clicked "fullscreen" in.
I am not sure how to rectify #1 or #3.
Problem 2 seems to be evident on Chrome on Linux in particular; using Firefox 20 on Linux, or Chrome on OS X, clicking fullscreen provides an actual fullscreen window. (Even the behavior on Chrome for Linux does not appear to be consistent.)
But I wanted this to work in Chrome as well; to that end, I put the following in the previous tinyMCE.init statement, which failed to work:
fullscreen_settings: {
theme_advanced_source_editor_width: 640,
theme_advanced_source_editor_height: 480
}
The debugging console shows that when I try to open the new window, jQuery is somehow not loaded (to wit, I get the error "Load jQuery first!"). Inserting a reference to it in fullscreen.htm does not seem to rectify the situation -- I get the same errors.
This is one of my first forays into TinyMCE, and I am feeling a touch out of my depth at this point. Any assistance would be quite welcome.
I have a JavaScript to re-size all my popup windows:
function resize()
{
window.resizeTo(240,230);
}
But now it is not resizing in Mozilla Firefox, but it was doing earlier, also
or if the popup window is opened in a new tab, it is not resizing, also in some browsers it is not also. Is there any piece of JavaScript code which works in all scenarios and all browsers?
Firefox comes with a preference for user to allow/disallow resizing of
window using Javascript. It's in Tools - Options - Content - Enable
Javascript -> [Advanced].
I am not sure if resizing is disabled by default, but you might want
to check your own Firefox installation first.
If it's disabled by default, then unfortunately there is nothing you
could do to resize the window after it has been opened. An ugly
workaround would be to open itself once again using window.open() with
the preferred size though.
Source: timdream (here)
I'll also add that:
You can't be assured that any browser will let you control the size of
windows you create. You can't even be sure you'll get a window at all
- people can instruct their browsers to open all new windows as browser tabs
Source: Pointy (same source as timdream)