Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter XHR requests without extension in Chrome Dev Tools?

I have used regex before but I'm no specialist. I've tried using stuff like /[^\.]+\b but I get too many results. I'm making request to another port on localhost (dev env) and since I'm using Angular 2 I'm fetching .js and .html files over XHR as well as normal REST calls.

I wan't to filter to only see REST XHR calls (ones without .js or .html extension). What would be the regex expression for this? As I've said, I've tried using /[^\.]+\b but it doesn't filter the ones ending with ".js".

requests which I want to avoid:

  • http://localhost:9011/dist/services/ng2-file-upload2/ng2-file-upload.js
  • http://localhost:9011/dist/services/form.js

requests which I do NOT want to avoid:

  • http://localhost:9011/user/account/type
  • http://localhost:8000/station/get
like image 780
ditoslav Avatar asked Oct 25 '25 01:10

ditoslav


1 Answers

You can filter by MIME Type in the filter panel, among others:

Filtering

In your case, you could filter out CSS and HTML files with:

-mime-type:text/css -mime-type:text/html

I tried to come up with a regex, but it doesn't seem to work in DevTools. It does work in JavaScript though:

^.*\.(?!(css|html)$).*$
  • Allow 0 or more of any character
  • Followed by a dot
  • At this point, it must not contain css or html at the end of the string
  • Followed by 0 or more characters

This should in theory filter out all results that contain exactly .css or .html at the end.

like image 74
Gideon Pyzer Avatar answered Oct 27 '25 14:10

Gideon Pyzer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!