Slap a site and see what falls out.
Slap is a simple CLI to assist with QA checking of a site.
If you slap https://example.com it will crawl all URLs found, both internal and external, but not move beyond the initial domain. After it is done, it will generate a report.
When Slap is finished running it will create a JSON of the queue as well as a HTML report, which will be stored in the report path, which can be set as a parameter or it defaults to the current directory.
Screenshots:
- The report overview shows general stats, a list of all status codes returned, and a list of all requests made
- The details view for each request shows stats about the request, headers, meta tags, where it was linked from, and accessibility issues
- The accessibility issues are listed by topic with each violation listed below with DOM selector and HTML snippet
git clone https://github.com/nagilum/slap
cd slap/src
dotnet build
Slap is written in C#, .NET 7, and uses Microsoft Playwright to perform the internal webpage requests. This allows us to take screenshots and run Axe Core accessibility scans. Serilog is used for logging during run.
slap https://example.com --engine firefox
- Set Rendering Engine
- Add Internal Domain
- Set Report Path
- Skip Scanning of Links
- Skip Scanning of Domains
- Set Timeout
- Set Window Size
- Load Queue File
Set which rendering engine to use.
--engine <name-of-engine>
Valid options are:
chromium
firefox
webkit
The default value is chromium
.
slap https://example.com --engine firefox
This will set the rendering engine to Firefox
.
Add a domain to be treated as an internal domain.
--add <domain>
slap https://example.com --add docs.example.com
This will follow links on both example.com
and docs.example.com
.
Set the folder path to save the report after scanning. It defaults to the current directory.
--path <path>
If the path does not exist, it will be created.
slap https://example.com --path ~/slap-reports/
This will set the report path to ~/slap-reports/
.
Set whick link types to skip. This command can be repeated to set more skips.
Valid options are:
assets
- Will skip both internal and external assets.external
- Will skip external assets and webpages.external-assets
- Will skip external assets.external-webpages
- Will skip external webpages.internal-assets
- Will skip internal assets.
slap https://example.com --skip external --skip internal-assets
This will skip internal assets, external assets, and external webpages.
Set a domain to be skipped. This command can be repeated to set more domains.
slap https://example.com --skip www.iana.org
This will scan the example.com domain, but skip scanning all links and assets found on www.iana.org.
Set the request timeout, in seconds, for each request. This setting defaults to 10 seconds.
slap https://example.com --timeout 2
This will set the timeout for all request to 2 seconds.
Set to save screenshots of each internal page that is scanned.
--screenshots
slap https://example.com --screenshots
This will tell the program to save a screenshot for each internal page that's scanned.
Set the window size. This will affect the size of the screenshot as well as some accessibility checks.
slap https://example.com --size 1024x768
This will set the window size to 1024x768 px.
This will load the specified queue file instead of crwling from first URL. Slap will then re-scan all the entries that failed in any way on the previous run.
slap --load ./reports/example.com/queue.json
This will load the specified queue file and re-scan based on it.