Issue 35980 in chromium: window size and position set to 0 right after window.open call

28 views
Skip to first unread message

chro...@googlecode.com

unread,
Feb 17, 2010, 6:37:03 AM2/17/10
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 Area-Undefined

New issue 35980 by chr...@netscript.com: window size and position set to 0
right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Chrome Version : 5.0.307.7 (Official Build 38400) beta (Mac)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 4: ok
Firefox 3.x: ok
IE 7:
IE 8:

What steps will reproduce the problem?
1. w=window.open(...)
2. alert(w.innerHeight)
3.

What is the expected result?
Some valid values for innerHeight, innerWidth, screenX and screenY.

What happens instead?
All values are set to 0.

Please provide any additional information below. Attach a screenshot if
possible.

Run the attachment.


Attachments:
winopen-position-chrome.html 364 bytes

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Sep 19, 2010, 1:15:30 AM9/19/10
to chromi...@chromium.org

Comment #1 on issue 35980 by lerc.sds: window size and position set to 0

alert("window.innerHeight:"+window.innerHeight);
var thing = document.getElementById('thing');
var dummy=thing.clientHeight;
alert("window.innerHeight:"+window.innerHeight);

For me, this code, in an iframe, will alert "window.innerHeight:0" followed
by "window.innerheight:600" (the iframe has height:600px)

6.0.472.53 (Official Build 57914)


chro...@googlecode.com

unread,
Mar 14, 2011, 10:50:28 AM3/14/11
to chromi...@chromium.org
Updates:
Labels: -Area-Undefined Area-WebKit

Comment #3 on issue 35980 by rse...@chromium.org: window size and position

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jun 23, 2012, 8:03:29 PM6/23/12
to chromi...@chromium.org

Comment #11 on issue 35980 by r...@cornell.edu: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Still occurs a year later in Version 19.0.1084.56 on Mac OS 10.7.3, with
popups, at least. Haven't tested iframe.

chro...@googlecode.com

unread,
Sep 3, 2012, 6:14:43 AM9/3/12
to chromi...@chromium.org

Comment #12 on issue 35980 by ricardo...@gmail.com: window size and
position set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

This is still happening and it affects ALL platforms.

Using Chrome 21...

Linux (Ubuntu 12.04): both iframe and popup give 0,0 values.
MacOS (10.6.8): both iframe and popup give 0,0 values.
Windows (7): iframe gives 0,0 and popup gives the parent window size
(instead of the popup window size).
ChromeOS: iframe is OK. popup gives 0,0.

http://mrdoob.com/files/temp/chrome/zeroInnerSizes.html
http://mrdoob.com/files/temp/chrome/zeroInnerSizes_iframe.html
http://mrdoob.com/files/temp/chrome/zeroInnerSizes_popup.html

chro...@googlecode.com

unread,
Sep 3, 2012, 6:37:58 AM9/3/12
to chromi...@chromium.org

Comment #13 on issue 35980 by anthoni....@gmail.com: window size and
position set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Using Chrome 21.0.1180.89 m on Windows 7 64-bit and only iframe is affected.

chro...@googlecode.com

unread,
Sep 3, 2012, 10:06:54 AM9/3/12
to chromi...@chromium.org

Comment #14 on issue 35980 by vic.gvo...@gmail.com: window size and
position set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

ETA?


chro...@googlecode.com

unread,
Sep 3, 2012, 2:00:32 PM9/3/12
to chromi...@chromium.org
Updates:
Status: Available
Owner: ---
Cc: pkotw...@chromium.org fsam...@chromium.org
Labels: Mstone-24

Comment #15 on issue 35980 by paulir...@chromium.org: window size and
position set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

pkotwicz, fsamuel - Do you have a good idea who could look at this ticket?
37 stars here, plus it looks like issue 13240 (10 stars) and issue 82673
are dupes as well.
I know a number of developers making Chrome Experiments hit this bug and
have nasty, unreliable hacks to work around it.

chro...@googlecode.com

unread,
Sep 10, 2012, 8:22:04 AM9/10/12
to chromi...@chromium.org

Comment #17 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, hope this is generic issue; not just related to iframe.. i am facing
this for popup..more details at
https://code.google.com/p/chromium/issues/detail?id=146771

chro...@googlecode.com

unread,
Sep 10, 2012, 8:33:07 AM9/10/12
to chromi...@chromium.org

Comment #18 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Any workaround?

chro...@googlecode.com

unread,
Sep 19, 2012, 5:10:40 AM9/19/12
to chromi...@chromium.org

Comment #19 on issue 35980 by j...@f2s.com: window size and position set to
Noticed this problem when Chrome already open and a page is opened in a new
tab eg. clicking on an icon (or right-click "open with" if not default
browser).
There's a delay before innerHeight/innerWidth return correct values.
Workarounds (win 7)- delays and polling for correct values seems to work
for all cases including iframes + popups.
Checking for expected size and using window.location.reload() works also
(as tab already open) and doesn't need delay - but is a reload.

chro...@googlecode.com

unread,
Sep 19, 2012, 7:02:09 AM9/19/12
to chromi...@chromium.org

Comment #20 on issue 35980 by wirede...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

This is a huge problem for iframes or at least it will be when polyfills
for "seamless" iframes get scheduled. I have a 300ms delay of doing nothing
while I wait for the contentDocument height to be measured reliably inside
(so that the iframe can resize itself to fit the content). There is no
workaround other than polling the height on an inverval and resize the
iframe repeatedly. If the iframe is intended to integrate seamlessly, this
will cause all elements below the iframe to jump around. In the latest
Aurora release, Firefox has now started emulating this questionable WebKit
feature and in Safari on iPad, it takes up to 1200ms to reliably measure
the height. With the "sandbox" attribute set to bring iframes back in
business, this state of affairs is not optimal.

chro...@googlecode.com

unread,
Sep 19, 2012, 7:16:04 AM9/19/12
to chromi...@chromium.org

Comment #21 on issue 35980 by wirede...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Note with regards to comment #20 that the seamless iframe depends on
correctly measuring the body.offsetHeight and not the window.innerHeight.
This makes it slightly off-topic for this bug, but not less critical.
Everything that can be measured will be apparently be measured wrong in a
user-created document. This must be quantum computing.

chro...@googlecode.com

unread,
Oct 11, 2012, 1:10:55 AM10/11/12
to chromi...@chromium.org

Comment #22 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, it is more than a month now since this is on your plate with 49
stars; do you have any update on this, when this will get fixed/released or
it will remain as a limitation from chrome side?

chro...@googlecode.com

unread,
Oct 12, 2012, 11:24:53 AM10/12/12
to chromi...@chromium.org

Comment #23 on issue 35980 by gav...@chromium.org: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Thanks for the ping ameyg7. I'll peek at it today, and see if I can figure
out what's up or find someone better to triage this.

chro...@googlecode.com

unread,
Oct 31, 2012, 11:34:35 AM10/31/12
to chromi...@chromium.org

Comment #24 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, any update?

chro...@googlecode.com

unread,
Nov 11, 2012, 2:48:27 PM11/11/12
to chromi...@chromium.org

Comment #25 on issue 35980 by da...@42andpark.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

I discovered this thread after banging my head on this one for a while. I
can confirm that things seem to work properly for a while, and then for
reasons unknown to me, the browser will break and then it returns 0 when it
should not. Once it starts returning 0, it will continue returning 0.
Sometimes refreshing the browser (F5 or Ctrl-F5 on Windows) fixes this,
sometimes not.

The thing I have been most surprised about, is that I see this not only on
Chrome, but FireFox and IE too. Can anyone explain why this bug is seen on
other browsers as well?

chro...@googlecode.com

unread,
Nov 11, 2012, 3:48:34 PM11/11/12
to chromi...@chromium.org

Comment #26 on issue 35980 by da...@42andpark.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

The following code seems to be working for me as a workaround. If it
doesn't get back a size, it essentially "sleeps" for 1/10th of a second (I
know JavaScript doesn't have a real sleep() function), then tries again.
Repeat for up to 2 seconds, and if you still don't have a size, just tell
the user to try again. No penalty if the sizes just happen to be there the
first time. Yuck, what a hacky word-around. I hope someone can come up
with a better way than this?

var retries = 20; // Wait up to 2 seconds total
function delayedLoader()
{
var x,y;
if (self.innerHeight) // all except Explorer
{
x = self.innerWidth;
y = self.innerHeight;
}
else if (document.documentElement &&
document.documentElement.clientHeight)
// Explorer 6 Strict Mode
{
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
x = document.body.clientWidth;
y = document.body.clientHeight;
}

if (x == 0 || y == 0) {
if (retries-- > 0)
setTimeout(delayedLoader, 100);
else
alert("Your browser isn't responding quickly enough. Try loading this
page again.");
} else {
// Your real code goes here
}
}

$(window).load(function(){
setTimeout(delayedLoader, 100);
});


chro...@googlecode.com

unread,
Nov 11, 2012, 4:41:41 PM11/11/12
to chromi...@chromium.org

Comment #27 on issue 35980 by da...@42andpark.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Sorry, I would have edited my prior posting if I could: You might want to
consider increasing the delay each time you wait.

chro...@googlecode.com

unread,
Nov 19, 2012, 4:08:15 AM11/19/12
to chromi...@chromium.org

Comment #28 on issue 35980 by apa...@digite.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, any update from your side?

chro...@googlecode.com

unread,
Nov 19, 2012, 4:09:36 AM11/19/12
to chromi...@chromium.org

Comment #29 on issue 35980 by ame...@gmail.com: window size and position

chro...@googlecode.com

unread,
Nov 19, 2012, 9:59:05 AM11/19/12
to chromi...@chromium.org

Comment #30 on issue 35980 by gav...@google.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Aye, I think I have a fix in the pipeline. I should finish it up and land
it this week; this bug will update then, and it should make dev channel
around the 28th. If I am pokey, expect it to take another week or so.

chro...@googlecode.com

unread,
Nov 19, 2012, 11:43:09 PM11/19/12
to chromi...@chromium.org

Comment #31 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Thanks for update Gavin, this has been pending from Sept, please update
once you have fixed this & it would be better if you can confirm
release(stable not beta)in which fix will be available, along with release
date.

chro...@googlecode.com

unread,
Nov 20, 2012, 1:19:04 AM11/20/12
to chromi...@chromium.org

Comment #32 on issue 35980 by da...@42andpark.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Although I am happy to see this fixed, sadly, because this bug occurs in
other browsers (FireFox and IE for me) and older versions, I think the
hacky work around code I posted earlier will probably have to stay in place
for a number of years. Kind of sad. But thank you so much for fixing this.

What is the fix for this by the way, and would the approach to this fix
work for other browsers as well (assuming their developers followed a
similar approach)?

chro...@googlecode.com

unread,
Dec 3, 2012, 12:17:13 PM12/3/12
to chromi...@chromium.org

Comment #33 on issue 35980 by xevilg...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

works great on my 19" laptop lol

chro...@googlecode.com

unread,
Dec 4, 2012, 12:59:04 AM12/4/12
to chromi...@chromium.org

Comment #34 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, any updates?

chro...@googlecode.com

unread,
Dec 11, 2012, 4:31:31 AM12/11/12
to chromi...@chromium.org

Comment #35 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, still waiting for update from your side

chro...@googlecode.com

unread,
Dec 18, 2012, 8:20:39 AM12/18/12
to chromi...@chromium.org

Comment #36 on issue 35980 by apa...@digite.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, please be kind enough to update on this one, thanks

chro...@googlecode.com

unread,
Dec 18, 2012, 8:23:50 AM12/18/12
to chromi...@chromium.org

Comment #37 on issue 35980 by ame...@gmail.com: window size and position

chro...@googlecode.com

unread,
Jan 11, 2013, 5:43:18 AM1/11/13
to chromi...@chromium.org

Comment #38 on issue 35980 by tk...@chromium.org: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Issue 169250 has been merged into this issue.

chro...@googlecode.com

unread,
Jan 11, 2013, 9:22:25 PM1/11/13
to chromi...@chromium.org
Updates:
Labels: -Mstone-24 Mstone-25

Comment #39 on issue 35980 by tha...@chromium.org: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

24 is out. Bump out further if this isn't done on trunk yet.

chro...@googlecode.com

unread,
Jan 11, 2013, 9:42:25 PM1/11/13
to chromi...@chromium.org
Updates:
Labels: -Mstone-25 Mstone-26

Comment #40 on issue 35980 by gav...@chromium.org: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jan 26, 2013, 12:24:19 AM1/26/13
to chromi...@chromium.org

Comment #41 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

Gavin, when can we expect fix for this? in which chrome version[stable
release]?

chro...@googlecode.com

unread,
Apr 23, 2013, 8:35:36 AM4/23/13
to chromi...@chromium.org

Comment #45 on issue 35980 by ame...@gmail.com: window size and position
set to 0 right after window.open call
http://code.google.com/p/chromium/issues/detail?id=35980

What is the status of this bug?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Jul 9, 2015, 4:32:44 AM7/9/15
to chromi...@chromium.org
Updates:
Labels: -Cr-Blink Cr-Blink-Window-Dialog

Comment #47 on issue 35980 by tk...@chromium.org: window size and position
set to 0 right after window.open call
https://code.google.com/p/chromium/issues/detail?id=35980

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Oct 15, 2015, 11:42:43 PM10/15/15
to chromi...@chromium.org
Updates:
Cc: rponn...@chromium.org dhar...@chromium.org mikelawt...@chromium.org

Comment #51 on issue 35980 by domi...@chromium.org: window size and
position set to 0 right after window.open call
https://code.google.com/p/chromium/issues/detail?id=35980

Issue 154559 has been merged into this issue.
Reply all
Reply to author
Forward
0 new messages