ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

close() method is not properly called #1039

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:
onbeforeunload() method for a browser is not called when close() method is 
called and it is forcefully closing the browser.

Steps to reproduce:
1. Open browser console and execute "window.onbeforeunload=function() 
{debugger}"
2. Execute driver.close() on a chrome browser.

Actual:
Before closing the window, the "window.onbeforeunload=function() {debugger}"
is not getting executed.

Expected:
Before closing the window, the "window.onbeforeunload=function() {debugger}"
should be executed.

Original issue reported on code.google.com by gibralto...@gmail.com on 17 Feb 2015 at 7:16

GoogleCodeExporter commented 9 years ago
please provide complete steps. (driver, URL, ... etc)

Original comment by andrewch...@chromium.org on 17 Feb 2015 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Can you please provide complete details. This will help us to recreate the issue

Original comment by gmanikp...@chromium.org on 4 Mar 2015 at 10:19

GoogleCodeExporter commented 9 years ago
1) You can use any url.
2) chromedriver.exe version is 2.14

3) write a script to open google and then call driver.close()
4) Debug the code and stop the debugger at driver.close().
4) Press F12 and open the onsole and type 'window.onbeforeunload=function() 
{debugger}'
5) This will be called whenever the browser is closed.
6) Now resume the debugger of the program.
7) It does not get stop at the debugger.

This means the close is not happening properly. Execute the same in Firefox and 
it works.

Why this debugger needs to be called is, in my project when one tab is closed 
then another tab needs to know that the tab is closed and it has to show a 
popup message, which is not happening in chrome, but running fine in firefox.

Please let  me know if yyou need extra information.

Original comment by gibralto...@gmail.com on 9 Mar 2015 at 10:59

GoogleCodeExporter commented 9 years ago

Original comment by gmanikp...@chromium.org on 1 Apr 2015 at 6:39

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 2 Apr 2015 at 10:37