Site Navigation

Thursday, April 30, 2009

bug 436 - Google Chrome alert() eats your content

Issue: #436
Affects: Google Chrome 1, Google Chrome 2
Fixed in: Google Chrome 5 (possibly earlier, please inform us if you know the exact version)

This particular bug took some time to figure out as it only happens under certain circumstances.

The JavaScript window.alert() function in Chrome will eat (truncate) some of your message if your content meets the following criteria.

If one of the lines in your multi-line message contains 40 or more characters without spaces.

Example:

<script type="text/javascript">
var msg = 'You can not see the secret word in Google Chrome!\n';
msg += '=========================================\n';
msg += 'The Secret word is: Bamboozled!';
alert(msg);
</script>


You don't believe me, do you? I wouldn't either... so here, try it!



In other browsers you get the secret word, but in Chrome its gone!

Well it gets even more interesting...

So here's what we've found so far:

  • The line after the line with 40+ non-space characters doesn't render

  • Any text beyond the 40+ non-space characters on the same line also doesn't render

  • A Blank line is rendered after the 40+ non-space characters line

  • The content 2 lines after the 40+ non-space characters line DOES render just fine





Known Workarounds: None.


Related Issues: None.


Bug/Site Feedback |
Submit a bug