<?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>187502</bug_id>
          
          <creation_ts>2018-07-09 19:24:54 -0700</creation_ts>
          <short_desc>Content blocker fails to block on internal page load</short_desc>
          <delta_ts>2018-07-25 15:40:57 -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>New Bugs</component>
          <version>WebKit Local Build</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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 name="Jeff Johnson">opendarwin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1440696</commentid>
    <comment_count>0</comment_count>
      <attachid>344656</attachid>
    <who name="Jeff Johnson">opendarwin</who>
    <bug_when>2018-07-09 19:24:54 -0700</bug_when>
    <thetext>Created attachment 344656
content blocking rules

If you load a page from the address bar, then the content blocking rules apply, but if a page redirects, it can bypass the content blocking rules. This happens in Safari, as well as in the MiniBrowser sample project.

Steps to reproduce:
1. Build WebKit
2. Run MiniBrowser
3. Open &quot;Debug&quot; menu
4. Select &quot;Show Extensions Manager&quot;
5. Click the + button
6. Select the attachment &quot;test.json&quot;
7. In the address bar, load https://developer.apple.com/search/
8. Enter &quot;NSArray&quot; in the search field, and press return
9. Press the reload button

The content blocking rules specify that &quot;https://developer.apple.com/search/?q=NSArray&quot; should be blocked. In step 8, the page redirects to &quot;https://developer.apple.com/search/?q=NSArray&quot;, but the content blocking rules do not block it. In step 9, however, the content blocking rules do apply, and you see &quot;Content blocker prevented frame displaying https://developer.apple.com/search/?q=NSArray from loading a resource from https://developer.apple.com/search/?q=NSArray&quot; in the JavaScript console.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1441028</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-07-10 17:13:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/42048265&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1445141</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-07-25 13:46:30 -0700</bug_when>
    <thetext>Is this a regression?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1445159</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-07-25 14:03:14 -0700</bug_when>
    <thetext>Not a real navigation (or redirect), the page changes the URL via:
0x15f300d50 - Document::setURL(https://developer.apple.com/search/?q=NSMutableArray)
1   0x10aa3daa1 WebCore::Document::setURL(WebCore::URL const&amp;)
2   0x10aa58607 WebCore::Document::updateURLForPushOrReplaceState(WebCore::URL const&amp;)
3   0x10aeb7c55 WebCore::History::stateObjectAdded(WTF::RefPtr&lt;WebCore::SerializedScriptValue, WTF::DumbPtrTraits&lt;WebCore::SerializedScriptValue&gt; &gt;&amp;&amp;, WTF::String const&amp;, WTF::String const&amp;, WebCore::History::StateObjectType)
4   0x10a2864c3 WebCore::jsHistoryPrototypeFunctionPushState(JSC::ExecState*)

No navigation happens, all Ajax.

Not convinced this is a bug also we should confirm with Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1445162</commentid>
    <comment_count>4</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2018-07-25 14:08:56 -0700</bug_when>
    <thetext>This web page is loading https://developer.apple.com/search/search_data.php?q=NSArray&amp;results=500 which does not match your rule</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1445195</commentid>
    <comment_count>5</comment_count>
    <who name="Jeff Johnson">opendarwin</who>
    <bug_when>2018-07-25 15:38:28 -0700</bug_when>
    <thetext>I see. Wow, I didn&apos;t realize until now that HTML5 allows you to arbitrarily manipulate the browser address bar in a misleading way. Can I file a bug against that? ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1445196</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-07-25 15:40:57 -0700</bug_when>
    <thetext>(In reply to opendarwin from comment #5)
&gt; I see. Wow, I didn&apos;t realize until now that HTML5 allows you to arbitrarily
&gt; manipulate the browser address bar in a misleading way. Can I file a bug
&gt; against that? ;-)

Sure, against the HTML spec though :)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>344656</attachid>
            <date>2018-07-09 19:24:54 -0700</date>
            <delta_ts>2018-07-09 19:24:54 -0700</delta_ts>
            <desc>content blocking rules</desc>
            <filename>test.json</filename>
            <type>application/json</type>
            <size>188</size>
            <attacher name="Jeff Johnson">opendarwin</attacher>
            
              <data encoding="base64">WwogICAgewogICAgICAgICJ0cmlnZ2VyIjogewogICAgICAgICAgICAidXJsLWZpbHRlciI6ICJe
aHR0cHM/Oi8vZGV2ZWxvcGVyXFwuYXBwbGVcXC5jb20vc2VhcmNoL1xcP3E9TlNBcnJheSIKICAg
ICAgICB9LAogICAgICAgICJhY3Rpb24iOiB7CiAgICAgICAgICAgICJ0eXBlIjogImJsb2NrIgog
ICAgICAgIH0KICAgIH0KXQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>