Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34044 > unrolled thread
| Started by | Egor Ovechkin <egorka1391@gmail.com> |
|---|---|
| First post | 2017-09-27 22:30 -0700 |
| Last post | 2017-09-28 09:58 -0300 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.lang.javascript
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
| From | Egor Ovechkin <egorka1391@gmail.com> |
|---|---|
| Date | 2017-09-27 22:30 -0700 |
| Subject | window.stop() in Chrome 61 |
| Message-ID | <fad77e3c-e481-404e-811e-117436369ec6@googlegroups.com> |
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();
})
[toc] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2017-09-28 05:41 -0700 |
| Message-ID | <9d56b910-cd9e-4345-a673-659b8f2ea53b@googlegroups.com> |
| In reply to | #34044 |
Egor Ovechkin wrote:
> 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();
> })
Sounds like a regression, did you submit a ticket?
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2017-09-28 05:53 -0700 |
| Message-ID | <8e6f76ce-ef69-4c43-9196-7739f3a0a17c@googlegroups.com> |
| In reply to | #34046 |
On Thursday, September 28, 2017 at 2:42:11 PM UTC+2, Michael Haufe (TNO) wrote:
> Egor Ovechkin wrote:
> > 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();
> > })
>
> Sounds like a regression, did you submit a ticket?
Assuming the report is faithful, which I'd doubt (*), sounds more like a
patch. Allowing a script to stop page unload (in any way) is a security
hazard and has been disallowed in all decent browsers since more than a
decade.
(*) <https://www.w3.org/TR/html5/browsers.html#dom-window-stop>
Julio
[toc] | [prev] | [next] | [standalone]
| From | Joao Rodrigues <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2017-09-28 09:58 -0300 |
| Message-ID | <oqirmh$fpn$1@gioia.aioe.org> |
| In reply to | #34044 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web