## System * Version: 0.24.0 * Platform: Windows 10 64-bit * Firefox: 66.0.2 * Selenium: C# 3.141.0 ## Testcase ``` using OpenQA.Selenium; using OpenQA.Selenium.Firefox; namespace Test { internal static class Launcher { public static void Main() { var firefoxOptions = new FirefoxOptions { BrowserExecutableLocation = @"..\firefox\firefox.exe" }; firefoxOptions.SetPreference("dom.disable_beforeunload", false); var webDriver = new FirefoxDriver(@"..\geckodriver", firefoxOptions); webDriver.Navigate().GoToUrl("https://google.com"); webDriver.ExecuteScript("window.top.onbeforeunload = function() { return confirm('123'); };"); webDriver.FindElement(By.TagName("body")).Click(); webDriver.Quit(); } } } ``` webDriver.Quit() never returns