Closed Bug 144069 Opened 23 years ago Closed 14 years ago

javascript window resize shouldn't work when more than one tab

Categories

(SeaMonkey :: Tabbed Browser, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 565541

People

(Reporter: john.p.baker, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020507 BuildID: 2002050706 This is closely related to bug 103452. As pointed out in bug 143729, if you allow javascript to resize windows this can have horrible effects when viewing using tabbed browsing. Basically, one tab can control the size of all the others. I suspect that javascript window resize should only be allowed when there is only one tab open in the window, irrespective of the preferences attachment to follow
Attached file test case
In a clean profile (or one that allows javascript to resize windows), open this attachment in a new tab. Go to a different tab and try to resize window.
Confirming for investigation.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Same problem for me - also, the window position is saved :/
QA Contact: sairuh → pmac
Don't know much about JavaScript, but I'm guessing that's what's happening at the following link: http://www.samsung.com/Features/TechnologyLeadership/Exhibition/cebit2003/
Reassigning to me. I'm not sure if we need this restriction or not; I will try to get more opinions.
Assignee: jaggernaut → mstoltz
I think there could be done some modification in Edit -> Preferences -> Advanced -> Scripts & Plug-ins -> Allow scripts to. The checkboxes (some of them) should have three states: unchecked for disabling the feature completely, "semi-checked" (checked box with gray bg or whatever) for allowing the feature only for windows opened with JavaScript (window.open()), and checked for allowing the feature completely. We hate when sites resize the browser window on their start page. On the other hand this feature is great when viewing some gallery - clicking a thumbnail usually opens a window using window.open() method, and such windows should be resizable by JavaScript (as they usualy resize to fit the image they show). This would also solve the JS-resizing of the tabbed windows, because JS-windows don't open in a tab.
It's not fair that a single tabbed website can take control over the entire application. We're up to Firefox 0.9 now, and this is still broken :/ I've voted :)
Suggestion: when more than one tab is opened, window resizing should be disabled in all cases, regardless of the user's setting in Script settings.
(In reply to comment #8) > Suggestion: when more than one tab is opened, window resizing should be disabled > in all cases, regardless of the user's setting in Script settings. more exactly: when the page to be opened is opened in a new tab, ant there is at least one other tab already open.
This is not broken in Epiphany. But still broken in Mozilla and Firefox..
Assignee: security-bugs → nobody
QA Contact: pmac → tabbed-browser
*** Bug 246914 has been marked as a duplicate of this bug. ***
I have no experience in these matters but could the solution to this bug not be very similar to the solution in bug 103452. At the moment resize events are followed in nsGlobalWindow::HandleDOMEvent: 1194 if (aEvent->message == NS_RESIZE_EVENT) { 1195 mIsHandlingResizeEvent = PR_TRUE; 1196 } right? If one tries to DispatchCustomEvent("DOMWindowResize") there and then counts the number of tabs the way it was done in tabbrowser.xml in attachment 86328 [details] [diff] [review] before returning. Could that work or don't I have to waste my time trying that?
I think any toolbar, not just the tab bar, should be sufficient reason to consider a window user-controlled and not let a web site resize it. See bug 186708.
Summary: javascript window resize shouldn't work when more than one tab → javascript window resize shouldn't work when more than one tab
*** Bug 332630 has been marked as a duplicate of this bug. ***
*** Bug 339648 has been marked as a duplicate of this bug. ***
*** Bug 347579 has been marked as a duplicate of this bug. ***
What will you do for the case of the user typing in javascript:window.resizeTo(800,600)? This is a case where the user clearly knows what they are doing. Disable that, and you break a DOM Level 0 feature completely. I understand the concern about pages resizing tabbed windows without the user's permission. But don't stop the user from doing the same himself. (I note that Firefox 1.5.0.6 has re-enabled window.resizeTo() for bug 309251, and SeaMonkey 1.0.4 has it disabled thanks to bug 317819.)
(In reply to comment #17) > What will you do for the case of the user typing in > javascript:window.resizeTo(800,600)? > Expanding the advanced options in a similar way to the image download exceptions (Tools > Options > Content > "Images"..... [Exceptions]) would go very far to squash this bug. Myself, I'm getting particularly annoyed by this bug since it resizes my window even if it full-screen. I have about 30 tabs open at all times and my Firefox window is always, yet http://www.saeverything.co.za/, resizes my window.
Previous post led me to another question - what's the point of changing window size for the page? resizeTo() changes size of whole window, not the client area available to the page. Moreover, if there are toolbars, main menu, tab bar, etc. in that window, page would not get the requested client area.
Blocks: eviltraps
Product: Core → SeaMonkey
Still not solved since 2002. Sites like (don't visit) http://www.nobrain.dk/ are annoying. You cannot catch the window.
This was fixed for Firefox as part of the patches in bug 565541. Did that fix it for SeaMonkey too?
> This was fixed for Firefox as part of the patches in bug 565541. > Did that fix it for SeaMonkey too? Appears to have done so. WFM: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0a1) Gecko/20110604 Firefox/7.0a1 SeaMonkey/2.2a1pre
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: