<?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>297838</bug_id>
          
          <creation_ts>2025-08-24 06:00:53 -0700</creation_ts>
          <short_desc>dNR: fails to match separator `^` to end of URL in `urlFilter`</short_desc>
          <delta_ts>2026-05-01 03:16:11 -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>WebKit Extensions</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>rhill</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>carlosj-webkit-bugzilla</cc>
    
    <cc>dotproto</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2138520</commentid>
    <comment_count>0</comment_count>
    <who name="">rhill</who>
    <bug_when>2025-08-24 06:00:53 -0700</bug_when>
    <thetext>The official DNR documentation[1] (my emphasis):

&gt; &apos;^&apos; : Separator character: This matches anything except a letter, a digit, or one of the following: _, -, ., or %. **This also match the end of the URL.**

For instance the following filter should visually break the web site `https://arstechnica.com/`:

  {
    &quot;action&quot;: {
      &quot;type&quot;: &quot;block&quot;
    },
    &quot;condition&quot;: {
      &quot;resourceTypes&quot;: [
        &quot;stylesheet&quot;
      ],
      &quot;urlFilter&quot;: &quot;arstechnica.net/wp-content/themes/*.css^&quot;
    },
    &quot;id&quot;: 5
  }

However the stylesheets are not blocked as expected, the following network request is not blocked by the above rule:

    https://cdn.arstechnica.net/wp-content/themes/ars-v9/public/css/app.6e4698.css

The source code comment[2] appears to support that the conversion process does not take into account that `^` should also match end of URL:

&gt; // &apos;^&apos; : Separator character: This matches anything except a letter, a digit or one of the following: _ - . %.

Note: the above issue can be easily reproduce in the extension uBlock Origin Lite, in which it is possible to directly enter DNR rules after enabling &quot;Develop&quot; option in its dashboard, which will make available a &quot;Custom DNR rules&quot; editor in which the above rule can be copy/pasted.

---

[1] https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest#type-RuleCondition

[2] https://github.com/WebKit/WebKit/blob/c9ff2b60570e45499e67a9cf5d72a7b567850a1f/Source/WebKit/UIProcess/Extensions/Cocoa/_WKWebExtensionDeclarativeNetRequestRule.mm#L1166</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138521</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-08-24 06:01:24 -0700</bug_when>
    <thetext>&lt;rdar://problem/159049652&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2166801</commentid>
    <comment_count>2</comment_count>
    <who name="Simeon Vincent">dotproto</who>
    <bug_when>2025-12-17 18:23:49 -0800</bug_when>
    <thetext>I&apos;m interested in working on this issue. I am currently setting up my local development environment for WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2172310</commentid>
    <comment_count>3</comment_count>
    <who name="Simeon Vincent">dotproto</who>
    <bug_when>2026-01-15 13:13:51 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/56662</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>