JustinBeckwith/linkinator

Crawl single page applications

Closed this issue ยท 5 comments

๐Ÿ‘‹ Does linkinator support crawling single page applications? I tried it locally using npx but that didn't seem to have worked. Just wanted to double check. Thanks!

Thanks for the idea! When you say "single page applications", I'm kind of curious what you expect to have happen. Today this grabs the contents of the site, and does static analysis to parse the HTML and discover any links. Could you describe some of the flows you'd like to test, and how you'd expect it to work? Examples would be lovely :)

@helfi92 that would require to bootstrap an application in the browser before scanning it. Linkinkator operates on the final HTML. If you can server-side render your SPA it works, though.

Yep. I think this could use a headless browser to test single page applications.

@JustinBeckwith Running linkinator on https://community-tc.services.mozilla.com/docs/ for example shows:

> npx linkinator https://community-tc.services.mozilla.com/docs/
npx: installed 213 in 7.08s
๐ŸŠโ€โ™‚๏ธ crawling https://community-tc.services.mozilla.com/docs/
[200] https://community-tc.services.mozilla.com/docs/
[200] https://community-tc.services.mozilla.com/assets/runtime.75d3e1c5.js
[200] https://community-tc.services.mozilla.com/assets/12.9e8381cd.js
[200] https://community-tc.services.mozilla.com/static/env.js
[200] https://community-tc.services.mozilla.com/assets/14.f1045cbe.js
[200] https://community-tc.services.mozilla.com/assets/14.8abd768e.css
[200] https://community-tc.services.mozilla.com/assets/12.9fbeb06c.css
[200] https://community-tc.services.mozilla.com/assets/docs.0690b466.js



  [200] https://community-tc.services.mozilla.com/docs/
https://community-tc.services.mozilla.com/docs/
  [200] https://community-tc.services.mozilla.com/assets/runtime.75d3e1c5.js
  [200] https://community-tc.services.mozilla.com/assets/12.9e8381cd.js
  [200] https://community-tc.services.mozilla.com/static/env.js
  [200] https://community-tc.services.mozilla.com/assets/14.f1045cbe.js
  [200] https://community-tc.services.mozilla.com/assets/14.8abd768e.css
  [200] https://community-tc.services.mozilla.com/assets/12.9fbeb06c.css
  [200] https://community-tc.services.mozilla.com/assets/docs.0690b466.js

Just to set expectations - this isn't something I'm planning to support. It would add a pretty significant amount of complexity to the tool. Apologies!

No worries.