Issue metadata
Sign in to add a comment
|
JavaScript Endless-loop prevents closing of tab and browser
Reported by
mbrau...@googlemail.com,
Sep 13 2017
|
||||||||||||||||||||||||
Issue description
Chrome Version (from the about:version page):Version 61.0.3163.79 (Offizieller Build) (64-Bit)
Is this the most recent version:
OS + version: Linux vdhh-ubuntu-mb 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
CPU architecture (32-bit / 64-bit): 64-bit
Window manager:Unity
URLs (if relevant):
Behavior in Linux Firefox: InternalError: too much recursion
Behavior in Windows Chrome (if you have access to it):
What steps will reproduce the problem?
A page with this javascript:
$(document).ready(function() {
if(window.history && history.pushState){ // check for history api support
window.addEventListener('load', function(){
// create history states
history.pushState(-1, null); // back state
history.pushState(0, null); // main state
history.pushState(1, null); // forward state
history.go(-1); // start in main state
this.addEventListener('popstate', function(event, state){
// check history state and fire custom events
if(state = event.state){
event = document.createEvent('Event');
event.initEvent(state > 0 ? 'next' : 'previous', true, true);
this.dispatchEvent(event);
// reset state
history.go(-state);
return false;
}
}, false);
}, false);
}
});
and a click on the back button has as result, that neither tab nor browser are closeable.
What is the expected result?
Exeption: to manny recusions
What happens instead?
endless loop
Please provide any additional information below. Attach a screenshot
and backtrace if possible.
For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.
,
Sep 14 2017
Ok, i see it's not only this code. Some more of our business page code and this code causes the problem. I have to discus it with my co-workers. But here is a of the behaviour Firefox 55.0.2 (64-Bit) vs. Chrome Version 61.0.3163.79 (Offizieller Build) (64-Bit)
,
Sep 14 2017
Thank you for providing more feedback. Adding requester "ligimole@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 15 2017
mbraun81@ thanks for the issue. Tried this issue on Ubuntu 14.04 using the latest Stable 61.0.3163.79 with the below steps. 1. launched Chrome and opened Devtools. 2. Clicked on Console, and executed the above given javascript. 3. Can see some Uncaught TypeError and can close the tab and the browser. No endless loop is observed after the javascript is run in the console. Please find the attached screen shot and confirm if anything is missed here. Request you to please provide us the screen cast for the better understanding of the issue. Thanks..
,
Oct 17 2017
Removing from the bisect queue since we are not able to repro.
,
Oct 25 2017
,
Oct 25 2017
I haven't tried the actual code shown here, but it's a known issue that a JS loop will prevent a tab from closing if DevTools is open. Closing DevTools is the workaround. (That problem is discussed in issue 684202 .) |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by ligim...@chromium.org
, Sep 13 2017