Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

juztcode/http-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Http Filter

Small library that can be used to filter XMLHttpRequest based on the hostname.

Why use this?

  • Need a way to find all http calls from third party javascript libraries
  • Need to prevent unwanted http calls from javascript code.

How to add?

  • Add link to the html file
<script src="https://cdn.jsdelivr.net/gh/juztcode/[email protected]/src/http-filter.js"></script>
  • Initialize with accepted hostname list and match type ('exact', 'partial')
<script>  
HttpFilter([
    'sample.com'
], 'exact');
</script>
  • Thats it your http call will filter according to their hostname

Happy Coding :)