<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>91463</bug_id>
          
          <creation_ts>2012-07-16 19:08:40 -0700</creation_ts>
          <short_desc>add support for beforescriptexecute/afterscriptexecute event</short_desc>
          <delta_ts>2019-02-06 21:56:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#the-script-element</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HTML5, InRadar, WebExposed</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>32934</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Syoichi Tsuyuhara">syoichi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ayg</cc>
    
    <cc>cdumez</cc>
    
    <cc>cris.bugzilla</cc>
    
    <cc>djkrose</cc>
    
    <cc>eric</cc>
    
    <cc>herbert00</cc>
    
    <cc>joepeck</cc>
    
    <cc>kitit</cc>
    
    <cc>lquinn</cc>
    
    <cc>michael</cc>
    
    <cc>mike</cc>
    
    <cc>priston910423</cc>
    
    <cc>rniwa</cc>
    
    <cc>sroussey</cc>
    
    <cc>tomme87</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.bugzilla</cc>
    
    <cc>webkit</cc>
    
    <cc>zanetu</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>670899</commentid>
    <comment_count>0</comment_count>
    <who name="Syoichi Tsuyuhara">syoichi</who>
    <bug_when>2012-07-16 19:08:40 -0700</bug_when>
    <thetext>&gt; 2. Fire a simple event named beforescriptexecute that bubbles and is cancelable at the script element.
&gt;    If the event is canceled, then abort these steps.
&gt; (snip)
&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>672627</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-07-18 12:32:59 -0700</bug_when>
    <thetext>Do other browsers support this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>673041</commentid>
    <comment_count>2</comment_count>
    <who name="Syoichi Tsuyuhara">syoichi</who>
    <bug_when>2012-07-18 18:11:34 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Do other browsers support this?

Yes, it&apos;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&apos;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&apos;m not sure whether current Firefox&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>798007</commentid>
    <comment_count>3</comment_count>
    <who name="">zanetu</who>
    <bug_when>2012-12-28 15:38:47 -0800</bug_when>
    <thetext>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 &quot;beforescriptexecute&quot; whereas Chrome v23.0.1271.97 does not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>851827</commentid>
    <comment_count>4</comment_count>
    <who name="Joel Martin">webkit</who>
    <bug_when>2013-03-09 14:28:23 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>962269</commentid>
    <comment_count>5</comment_count>
    <who name="">tomme87</who>
    <bug_when>2013-12-21 13:36:51 -0800</bug_when>
    <thetext>Ran into this bug myself. Not having this functionality is very frustrating, specially when making userscripts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>995170</commentid>
    <comment_count>6</comment_count>
    <who name="">zanetu</who>
    <bug_when>2014-03-27 17:24:46 -0700</bug_when>
    <thetext>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. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123750</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2015-09-04 17:10:51 -0700</bug_when>
    <thetext>This is now covered by LayoutTests/http/tests/w3c/html/semantics/scripting-1/the-script-element/script-before-after-events.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123752</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-09-04 17:12:03 -0700</bug_when>
    <thetext>&lt;rdar://problem/22588270&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1124584</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Wyraz">michael</who>
    <bug_when>2015-09-09 01:29:23 -0700</bug_when>
    <thetext>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&apos;t work in webkit unless these events are implemented!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1134576</commentid>
    <comment_count>10</comment_count>
    <who name="kitit">kitit</who>
    <bug_when>2015-10-19 07:57:54 -0700</bug_when>
    <thetext>Come on guys, Firefox already implemented this, you didn&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1134580</commentid>
    <comment_count>11</comment_count>
    <who name="herbert00">herbert00</who>
    <bug_when>2015-10-19 08:26:45 -0700</bug_when>
    <thetext>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&apos;t because Chromium developers refuse to implement a feature that is officially part of the W3C HTML5 standard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1158852</commentid>
    <comment_count>12</comment_count>
    <who name="Cris Stringfellow">cris.bugzilla</who>
    <bug_when>2016-01-26 10:15:28 -0800</bug_when>
    <thetext>A polyfill : https://github.com/dosaygo/open-0/tree/master/script-events</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1337419</commentid>
    <comment_count>13</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2017-08-10 08:10:57 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503334</commentid>
    <comment_count>14</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:19:12 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503631</commentid>
    <comment_count>15</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-06 21:56:13 -0800</bug_when>
    <thetext>We&apos;re not going to implement this non-standard event, which has been removed from the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>