GoogleChrome / webdev-infra

Apache License 2.0
40 stars 28 forks source link

Warn of detected absolute URLs while scanning build output via UrlCrawl #59

Open Blazzike opened 1 year ago

Blazzike commented 1 year ago

PR #58 will introduce a UrlCrawl class/functionality that finds broken URLs. As a later feature, this class should also be able to find absolute URLs and print those as part of the final output.

Currently the output of failing HREFs prints as the following (note the first path is not actually the value of the href, absolute URLs are always displayed):

404 Not Found a[href="/tutorials/webgl/webgl_fundamentals/"] @ /webgl-transforms/

The detected absolute URLs could display along the lines of:

[!] Absolute a[href="/tutorials/webgl/webgl_fundamentals/"] @ /webgl-transforms/

Finally, this functionality ideally would be toggleable using a UrlCrawl option such as shouldWarnAbsolute.