Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #34049

Re: window.stop() in Chrome 61

From Joao Rodrigues <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: window.stop() in Chrome 61
Date 2017-09-28 09:58 -0300
Organization Aioe.org NNTP Server
Message-ID <oqirmh$fpn$1@gioia.aioe.org> (permalink)
References <fad77e3c-e481-404e-811e-117436369ec6@googlegroups.com>

Show all headers | View raw


Em 28/09/2017 02:30, Egor Ovechkin escreveu:
> Hello.
> I have code that stopped page unloading. It works in version 60, but does not work in 61. Do you know anything about this? Can I stopped unload in new version?
> 
> Simplistic, it looked so:
> 
> $(window).on('beforeunload', function() {
>    window.stop();
> })
> 

The window.stop() method stops window loading, not unloading [1][2]. 
Besides, it is not supported in IE. So I'd rather discard it.

I think you want to stop unloading, something like:

window.addEventListener("beforeunload", function (e) {
   // ...
   e.preventDefault();
});

If you want to present a message to the user before unloading, then 
you'll need a workaround for 'almost' cross-browser compatibility [3].

[1] <https://developer.mozilla.org/en-US/docs/Web/API/Window/stop>
[2] <https://html.spec.whatwg.org/#dom-window-stop>
[3] <https://developer.mozilla.org/pt-BR/docs/Web/Events/beforeunload>

-- 
Joao Rodrigues

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

window.stop() in Chrome 61 Egor Ovechkin <egorka1391@gmail.com> - 2017-09-27 22:30 -0700
  Re: window.stop() in Chrome 61 "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-09-28 05:41 -0700
    Re: window.stop() in Chrome 61 Julio Di Egidio <julio@diegidio.name> - 2017-09-28 05:53 -0700
  Re: window.stop() in Chrome 61 Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2017-09-28 09:58 -0300

csiph-web