-
Notifications
You must be signed in to change notification settings - Fork 363
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
feat(output): auto-open HTML file after scan #1412
base: v2
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #1412 +/- ##
==========================================
- Coverage 69.92% 69.76% -0.17%
==========================================
Files 186 186
Lines 18518 18562 +44
==========================================
Hits 12949 12949
- Misses 4874 4916 +42
- Partials 695 697 +2 ☔ View full report in Codecov by Sentry. |
Hmm, thinking a bit more, if we host it on a localhost port, users could potentially use SSH port forwarding to access the website if they are remotely accessing the server. But I don't know how likely this case would be. |
This is the workflow I typically use whenever I need to inspect a web page generated by some tool (e.g. documentation) |
Updated code to also host the HTML file on localhost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a flag --host
or similar where we assume output is a temporary file, format is html, and run the hosting part of the code
Added support to automatically open the HTML file in users' default browser after a scan finishes.
If the host flag is enabled, the HTML file will be saved in a temporary directory and then served on localhost.
If only specified the
--format html
, open the generated HTML file by using the rightopen
command for each OS (likexdg-open
for Linux,start
for Windows, andopen
for macOS). Simultaneously, the file is served on localhost for easy remote access.