Closed rjhampo closed 4 days ago
The changes look pretty good to me!
I will test this on a Windows machine, but I am unable to test on macOS as I do not have access to a macOS device, and emulating it is quite ... problematic.
Thanks for contributing to this project, I will merge it as soon as I am able to test it on Windows
I have just re-run on my Mac, it logged "FileNotFoundError: Could not find libxul.dylib (What the hell?!)"
If possible, could you specify the location of this file within your Firefox installation? A quick search tells me that the file is in "/Applications/Firefox.app/Contents/MacOS". However, I'm not familiar with Mac OS, hence I'm not sure if the path is correct or not
There's no file named "libxul.dylib" in "/Applications/Firefox.app/Contents/MacOS"
Okay, got it! I'll try to research more about this. It may take a while though since I don't have direct access to a Mac.
Platform
Operating System: Windows 11 Python Version: 3.12.7 Selenium Version: 4.25.0
Summary
I added a function _get_platform_dependent_params to make the package compatible with other platforms. When I first tried this package, I encountered errors coming from get_firefox_installation_path, get_undetected_firefox_path, patch_libxul_file, and the Firefox class constructor. The errors stem from hard-coded strings referring to Firefox in the Linux OS. The function that I added will help to at least put all the hard-coded paths in one place and adapt values based on the user platform.
I think this also fixes #1 although I wasn't able to test it out in MacOS. The changes should be minimal if it still doesn't work in it.
Aside from this, I also made a minor change in the constants in which the Firefox path key in "windows" is changed to "win32".