Bug 174018 - Drop beforeload event
Summary: Drop beforeload event
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-30 01:49 PDT by Yusuke Suzuki
Modified: 2017-07-02 02:05 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2017-06-30 01:49:45 PDT
I wonder if we can drop "beforeload" event support.
This is already dropped in Chrome long ago. (2014) https://bugs.chromium.org/p/chromium/issues/detail?id=333318
And Firefox does not support it. It has a bug attempting to support "beforeload" event. But it seems rejected. https://bugzilla.mozilla.org/show_bug.cgi?id=715695

And according to the Firefox's bug, "beforeload" event is introduced to be used by ad-blocking user extensions. However, we already have more efficient mechanism to implement ad-block.

Furthermore, "beforeload" event frequently causes some troubles because it can insert JS handler execution.
Comment 1 Ryosuke Niwa 2017-06-30 02:09:24 PDT
I don't think we're in the position to drop the beforeunload event. There are just too many Safari extensions and the web content (particularly enterprise websites) that rely on this feature.
Comment 2 Yusuke Suzuki 2017-06-30 02:18:06 PDT
(In reply to Ryosuke Niwa from comment #1)
> I don't think we're in the position to drop the beforeunload event. There

Ah, no. This bug intends to drop "beforeload" event. Not "beforeunload".
Is it typo? Or is there so many Safari extensions and the web content using "before load" event? If so, we cannot drop it :)

> are just too many Safari extensions and the web content (particularly
> enterprise websites) that rely on this feature.
Comment 3 Ryosuke Niwa 2017-06-30 02:22:58 PDT
(In reply to Yusuke Suzuki from comment #2)
> (In reply to Ryosuke Niwa from comment #1)
> > I don't think we're in the position to drop the beforeunload event. There
> 
> Ah, no. This bug intends to drop "beforeload" event. Not "beforeunload".
> Is it typo? Or is there so many Safari extensions and the web content using
> "before load" event? If so, we cannot drop it :)

Oh, oops. I misread.
Comment 4 Antti Koivisto 2017-06-30 06:00:13 PDT
My understanding is that we can't completely drop this yet due to amount of old style extensions using it. However we could stop exposing it to the web and make it extension-only.
Comment 5 Yusuke Suzuki 2017-07-01 01:27:02 PDT
(In reply to Antti Koivisto from comment #4)
> My understanding is that we can't completely drop this yet due to amount of
> old style extensions using it.

Oh, that's unfortunate thing...

> However we could stop exposing it to the web
> and make it extension-only.

It sounds nice direction to me.