This tool utilises chromedp, an automated browser which supports Chrome DevTools Protocol. It aims to enable users to profile a web pages' dependencies using network capability of the DevTools. The dependencies in this context means any fetch or XHR request emitted from the page, which most of the time means other services in which the pages relies on to.
To install this tool, run the following command:
go get -v github.com/tiket-libre/ajax-detector
There are couple of ways you can run this tool. One is by passing the page URLs as a command argument(s):
ajax-detector https://www.tiket.com https://www.tiket.com/pesawat
However, there's also a mechanism to load a configuration file by using the --config
file (or just -c
for short). Simply provide the path to your configuration file as the flag value. NOTE: using this flag will ignore the argument(s) in the previous example. The configuration file is formatted like the following:
[[pages]]
name = "Tiket.com - Main landing page"
url = "https://www.tiket.com"
[[pages]]
name = "Tiket.com - Pesawat landing page"
url = "https://www.tiket.com/pesawat"
[[pages]]
name = "Tiket.com - Hotel landing page"
url = "https://www.tiket.com/hotel"
And to use the configuration file run:
ajax-detector -c path/to/config.toml
Other than that, you can use these following flags as well.
Flags:
-c, --config string Path to configuration file (default "config.toml")
-h, --help help for page-profile
-o, --output string Specify directory Path path for output (default "output.csv")
-t, --timeout int Set timeout for the execution, in seconds (default 15)