-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a flag to ignore some results #4
Comments
Not as of now, but it's something I want to support. Both ignoring errors/warnings and ability to not test specific link/patterns. Will need some time and energy for that. PRs welcome. BTW, you can ignore the result by using the node library (instead of CLI). (This project is unmaintained as of now) |
Thanks for the response, do you have an example of how link can be ignored using the node library? Thanks again! |
From the README, something like following: const { checkLinks } = require("href-checker");
for await (const result of checkLinks(url, options)) {
console.log(result.type);
// -> "samePage", "sameSite", "offSite"
console.log(result.input);
// -> {
// "link": string, // URL of page being visited.
// "count": number, // Number of occurences of URL.
// }
console.log(result.output);
// -> {
// "pageExists": boolean, // Page resolved with HTTP 20* code.
// "status": number, // HTTP status code.
// "fragExists": boolean, // Element corresponding to fragment exists.
// "error": Error, // Error, if any.
// }
if (!result.output.pageExists) {
if (result.output.link === SOME_LINK) {
// do nothing
} else {
// log warning/error
}
}
} You can also check how the CLI does it: https://github.com/sidvishnoi/href-checker/blob/main/cli.ts |
Thank you, will play around with it |
Keeping it open for future. |
I was playing around with the tool and found few issues which make it not reliable. Not sure if this tool will be supported in the future but I'm just leaving the two main issues here if anyone wants to ever look into it.
Great tool overall, I think it would be useful for a lot of people but at the moment I believe it needs few fixes. Thanks for your help |
Can you share the URL? Or does it happen with almost every URL? Can you file separate issues for above? Thanks! |
Example:
I scan the website
One of the offsite links returns 404
Add a flag to ignore this specific offsite link so it doesn't show in the results
Would this be possible?
The text was updated successfully, but these errors were encountered: