-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fixes to get GHunt working in WSL 1 #14
Conversation
There are countless ways of getting to now wich system a script is running on. https://www.scivision.co/python-fine-grained-os-detection/ Also, those headers should be loaded dinamically (i.e. only if running on WSL) |
@@ -70,7 +70,7 @@ | |||
|
|||
tmprinter.out("Starting browser...") | |||
|
|||
driverpath = get_driverpath() | |||
driverpath = "./chromedriver.exe" |
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.
Using a hardcoded path is unacceptable
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.
Yes, we can't do this. :(
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.
This wasn't intended to be merged, did you two read the first sentence of the PR?
I don't expect this to be merged, but figured I'd create it in case it helps anyone else save some time when trying to get GHunt working in the following:
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.
I'll reorganize the driver process later and by the way checking if we can support the WSL or even checking it, but I don't think hardcoding a path and adding a lot of options without checking it is a good idea.
Thanks anyway for your edit, I add the WSL support in my todo list.
@@ -70,7 +70,7 @@ | |||
|
|||
tmprinter.out("Starting browser...") | |||
|
|||
driverpath = get_driverpath() | |||
driverpath = "./chromedriver.exe" |
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.
Yes, we can't do this. :(
I don't expect this to be merged, but figured I'd create it in case it helps anyone else save some time when trying to get GHunt working in the following:
Notes:
The reason for the hardcoding of
chromedriver.exe
indriverpath
:chromedriver.exe
rather thanchromedriver
, since you are invoking Chrome via Windows path, but this code prevents this from happening:lib/utils.py
:This never returns
Windows
when using WSL 1, this can be confirmed by running the following test, which results inlinux
being printed:The reason for adding all of the arguments in
lib/gmaps.py
:lib/gmaps.py
(if cfg["headless"]: ...
) are necessary, but I didn't have time to test removal of each one-by-one and this set has traditionally worked for me when using headless Chrome in other contexts (like Puppeteer). It's possible it would work with some being omitted.