<?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>288057</bug_id>
          
          <creation_ts>2025-02-19 21:08:15 -0800</creation_ts>
          <short_desc>[WebDriver][BiDi] Implement the script.addPreloadScript command</short_desc>
          <delta_ts>2026-04-08 20:11:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=288062</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=288065</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>281937</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
    
    <cc>sergedeh</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2096229</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-02-19 21:08:15 -0800</bug_when>
    <thetext>https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript

One of the cornerstones used by clients to make the browser to push custom messages through the `channels`, delivered as `script.message` events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2098604</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-02-26 21:09:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/145716105&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2196272</commentid>
    <comment_count>2</comment_count>
    <who name="Serge Deh">sergedeh</who>
    <bug_when>2026-04-02 05:47:18 -0700</bug_when>
    <thetext>Some defensive ideas for resource limits to prevent potential denial of service issues with preload scripts:

1. **Maximum number of preload scripts per session**
   - Cap number of preload scripts per session?
   - This would prevent memory exhaustion from unbounded script accumulation
   - We&apos;d need to return an appropriate BiDi error when the limit is exceeded
2. **Maximum function declaration length**
   - Cap size of function declaration
   - Prevents processing extremely large script payloads
   - Helps protect against memory and parsing overhead attacks
3. **Total memory limit for all preload scripts**
   - An aggregate limit across all preload scripts in a session
   - Could track both source code size and runtime overhead
   - Prevents cumulative memory exhaustion</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2198230</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-08 20:11:51 -0700</bug_when>
    <thetext>Committed 310815@main (17a80254d05d): &lt;https://commits.webkit.org/310815@main&gt;

Reviewed commits have been landed. Closing PR #57773 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>