112

I'm not sure how to modify the CustomRules.js file to only show requests for a certain domain.

Does anyone know how to accomplish this?

CVertex
  • 17,997
  • 28
  • 94
  • 124

5 Answers5

232

This is easy to do. On the filters tab, click "show only if the filter contains, and then key in your domain.

enter image description here

user3311522
  • 1,638
  • 3
  • 19
  • 33
Terrence
  • 2,732
  • 2
  • 18
  • 12
  • This should be treated as the answer now. Along with Eric's comment for http://stackoverflow.com/a/746776/157552 – Sameera May 04 '12 at 15:26
  • This is only the easy way. The @Marc Gravell is the thechnical way. I will not be able to open filers dialog when using fiddler programmatically. Edit the file and adding that is the way i've been looking for. – m3nda Feb 11 '15 at 12:55
  • I couldn't get this method to work with sessions printed by fiddler as part of it acting as a reverse proxy – void.pointer Jan 25 '16 at 17:44
  • Once the host has been added and the box turns yellow with the message `Changes not yet saved.` then you have to click on that actual message text to save the details (which is not at all obvious!). – SharpC Mar 22 '19 at 14:35
13

edit

Turns out it is quite easy; edit OnBeforeRequest to add:

if (!oSession.HostnameIs("www.google.com")) {oSession["ui-hide"] = "yup";} 

filters to google, for example.


(original answer) I honestly don't know if this is something that Fiddler has built in (I've never tried), but it is certainly something that Wireshark will do pretty easily - of course, you get different data (in particular for SSL) - so YMMV.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • Sometimes you'll need to filter by the path or the query, to catch certain requests not the whole activity. I found on the docs that. ```if (oSession.PathAndQuery=="/version1.css") { oSession.PathAndQuery="/version2.css"; }.``` Using first the `HostnameIS` then later the `PathAndQuery` you can filter exactly just 1 resource. Im impressed with Fiddler. Is not a net toy. – m3nda Feb 11 '15 at 12:58
5

My answer is somewhat similar to @Marc Gravels, however I prefer to filter it by url containing some specific string.

  1. You will need fiddler script - it's an add-on to fiddler.
  2. When installed go to fiddler script tag and paste following into OnBeforeRequest function. (Screenshot below)

     if (oSession.url.Contains("ruby:8080") || oSession.url.Contains("localhost:53929")) {  oSession["ui-hide"] = "yup";    }
    

enter image description here

This way you can filter by any part of url be it port hostname or whatever.

Hope this saves you some time.

Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
  • Especially useful for filtering out browerlink urls. Filtering by host alone does not do this. – rism Jan 26 '16 at 20:49
3

You can filter the requests using the filter tab in fiddler. Please see screenshots below. If you are using google chrome, be sure to use the correct process id in fiddler(from google chrome).

enter image description here enter image description here enter image description here

Ajit Goel
  • 4,180
  • 7
  • 59
  • 107
1

The Fiddler site has a cookbook of a whole bunch of things that you can do with CustomRules.js, including how to do exactly this :)

Simon Lieschke
  • 13,058
  • 6
  • 46
  • 60