Bug 91463 - add support for beforescriptexecute/afterscriptexecute event
Summary: add support for beforescriptexecute/afterscriptexecute event
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://www.whatwg.org/specs/web-apps/...
Keywords: HTML5, InRadar, WebExposed
Depends on:
Blocks: 32934
  Show dependency treegraph
Reported: 2012-07-16 19:08 PDT by Syoichi Tsuyuhara
Modified: 2019-02-06 21:56 PST (History)
20 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Syoichi Tsuyuhara 2012-07-16 19:08:40 PDT
> 2. Fire a simple event named beforescriptexecute that bubbles and is cancelable at the script element.
>    If the event is canceled, then abort these steps.
> (snip)
> 6. Fire a simple event named afterscriptexecute that bubbles (but is not cancelable) at the script element.
Comment 1 Alexey Proskuryakov 2012-07-18 12:32:59 PDT
Do other browsers support this?
Comment 3 zanetu 2012-12-28 15:38:47 PST
I can confirm this bug with Chrome v23.0.1271.97 on 64-bit Debian Unstable. 

Both Iceweasel v10.0.11 and Opera v12.12 support "beforescriptexecute" whereas Chrome v23.0.1271.97 does not.
Comment 4 Joel Martin 2013-03-09 14:28:23 PST
Just ran into this bug in Chrome 25.0.1364.97 [537.22 (@143379)]. Please add support to match firefox support and comply with the spec.
Comment 5 tomme87 2013-12-21 13:36:51 PST
Ran into this bug myself. Not having this functionality is very frustrating, specially when making userscripts.
Comment 6 zanetu 2014-03-27 17:24:46 PDT
Now that beforeload, which used to be the only workaround, is no longer supported (https://code.google.com/p/chromium/issues/detail?id=333318), this bug appears more urgent than ever. :(
Comment 7 Ryosuke Niwa 2015-09-04 17:10:51 PDT
This is now covered by LayoutTests/http/tests/w3c/html/semantics/scripting-1/the-script-element/script-before-after-events.html
Comment 8 Radar WebKit Bug Importer 2015-09-04 17:12:03 PDT
Comment 9 Michael Wyraz 2015-09-09 01:29:23 PDT
Advertisers have started to bypass adblockers by using special inline scripts. Recent approaches for analyzing and blocking these scripts (e.g. https://openuserjs.org/scripts/schwarztee/AdDefend_Klatsche/source) won't work in webkit unless these events are implemented!
Comment 10 kitit 2015-10-19 07:57:54 PDT
Come on guys, Firefox already implemented this, you didn't.

Therefore WebKit browsers fail certain HTML5 tests, like this one: http://www.w3c-test.org/html/semantics/scripting-1/the-script-element/script-before-after-events.html
Firefox passes all these tests.

I thought WebKit is all about supporting standards like HTML5?
Comment 11 herbert00 2015-10-19 08:26:45 PDT
This is very important functionality. The developers of AdBlock Plus (one of the most installed addons) need this to implement a new feature: https://issues.adblockplus.org/ticket/3207
But they can't because Chromium developers refuse to implement a feature that is officially part of the W3C HTML5 standard.
Comment 12 Cris Stringfellow 2016-01-26 10:15:28 PST
A polyfill : https://github.com/dosaygo/open-0/tree/master/script-events
Comment 13 Aryeh Gregor 2017-08-10 08:10:57 PDT
This is no longer in the spec, so if you actually want to implement it, you should probably get it re-added to the spec first.
Comment 14 Lucas Forschler 2019-02-06 09:19:12 PST
Mass move bugs into the DOM component.
Comment 15 Ryosuke Niwa 2019-02-06 21:56:13 PST
We're not going to implement this non-standard event, which has been removed from the spec.