Bug 91463
Summary: | add support for beforescriptexecute/afterscriptexecute event | ||
---|---|---|---|
Product: | WebKit | Reporter: | Syoichi Tsuyuhara <syoichi> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ap, ayg, cdumez, cris.bugzilla, djkrose, eric, herbert00, joepeck, kitit, lquinn, michael, mike, priston910423, rniwa, sroussey, tomme87, webkit-bug-importer, webkit.bugzilla, webkit, zanetu |
Priority: | P2 | Keywords: | HTML5, InRadar, WebExposed |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element | ||
Bug Depends on: | |||
Bug Blocks: | 32934 |
Syoichi Tsuyuhara
> 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.
http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Do other browsers support this?
Syoichi Tsuyuhara
(In reply to comment #1)
> Do other browsers support this?
Yes, it's Firefox 4+(Gecko 2+).
https://bugzilla.mozilla.org/show_bug.cgi?id=587931
https://developer.mozilla.org/en/DOM/element.onbeforescriptexecute
https://developer.mozilla.org/en/DOM/element.onafterscriptexecute
By the way, Opera's User JavaScript has BeforeScript/AfterScript event.
http://www.opera.com/docs/userjs/specs/#BeforeScript
http://www.opera.com/docs/userjs/specs/#AfterScript
But, I'm not sure whether current Firefox's implementation follow HTML spec.
related:
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-February/034629.html
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-May/035713.html
zanetu
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.
Joel Martin
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.
tomme87
Ran into this bug myself. Not having this functionality is very frustrating, specially when making userscripts.
zanetu
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. :(
Ryosuke Niwa
This is now covered by LayoutTests/http/tests/w3c/html/semantics/scripting-1/the-script-element/script-before-after-events.html
Radar WebKit Bug Importer
<rdar://problem/22588270>
Michael Wyraz
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!
kitit
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?
herbert00
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.
Cris Stringfellow
A polyfill : https://github.com/dosaygo/open-0/tree/master/script-events
Aryeh Gregor
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.
Lucas Forschler
Mass move bugs into the DOM component.
Ryosuke Niwa
We're not going to implement this non-standard event, which has been removed from the spec.