Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/livescan.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package api
import (
"encoding/json"
"fmt"
"slices"
)

type LiveScanOptions struct {
Expand All @@ -19,6 +20,10 @@ type LiveScanOptions struct {
} `json:"scanner"`
}

var DisabledFeatures = []string{
"stealth",
}

type LiveScanOption func(*LiveScanOptions)

func WithLiveScanTaskURL(url string) LiveScanOption {
Expand Down Expand Up @@ -59,6 +64,11 @@ func WithLiveScanScannerEnableFeatures(features []string) LiveScanOption {

func WithLiveScanScannerDisableFeatures(features []string) LiveScanOption {
return func(opts *LiveScanOptions) {
for _, feature := range features {
if slices.Contains(DisabledFeatures, feature) {
log.Warn(fmt.Sprintf("The feature '%s' is deprecated", feature))
}
}
opts.Scanner.DisableFeatures = features
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/pro/livescan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func init() {
scanCmd.Flags().IntP("capture-delay", "c", 10_000, "Delay after page has finished loading before capturing page content (in ms)")
scanCmd.Flags().StringToStringP("extra-headers", "H", map[string]string{}, "Extra headers to send with the request (e.g., User-Agent: urlscan-cli)")
scanCmd.Flags().StringSliceP("enable-features", "e", []string{}, "Features to enable (bannerBypass, downloadWait, fullscreen)")
scanCmd.Flags().StringSliceP("disable-features", "d", []string{}, "Features to disable (annotation, dom, downloads, hideheadless, pageInformation, responses, screenshot, screenshotCompression, stealth)")
scanCmd.Flags().StringSliceP("disable-features", "d", []string{}, "Features to disable (annotation, dom, downloads, hideheadless, pageInformation, responses, screenshot)")
scanCmd.Flags().BoolP("blocking", "b", true, "Whether to do a blocking scan or not")

addVisibilityFlag(scanCmd)
Expand Down
2 changes: 1 addition & 1 deletion docs/urlscan_pro_livescan_scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ urlscan pro livescan scan [flags]
```
-b, --blocking Whether to do a blocking scan or not (default true)
-c, --capture-delay int Delay after page has finished loading before capturing page content (in ms) (default 10000)
-d, --disable-features strings Features to disable (annotation, dom, downloads, hideheadless, pageInformation, responses, screenshot, screenshotCompression, stealth)
-d, --disable-features strings Features to disable (annotation, dom, downloads, hideheadless, pageInformation, responses, screenshot)
-e, --enable-features strings Features to enable (bannerBypass, downloadWait, fullscreen)
-H, --extra-headers stringToString Extra headers to send with the request (e.g., User-Agent: urlscan-cli) (default [])
-h, --help help for scan
Expand Down