Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
License | Version | ||
Github Actions | Coverage | ||
Supported versions | Wheel | ||
Status | Downloads | ||
All Contributors |
Python library for detecting and launching browsers
I recently wrote a snippet for detecting installed browsers in an OSX machine in
https://github.com/mitmproxy/mitmproxy/issues/5247#issuecomment-1095337723 based on https://github.com/httptoolkit/browser-launcher
and I thought this could be useful to other devs since I cannot find an equivalent library of httptoolkit/browser-launcher
in Python
and the known webbrowser
standard library does not support arguments.
pip install pybrowsers
import browsers
import browsers
print(list(browsers.browsers()))
# [{'browser_type': 'chrome', 'path': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 'display_name': 'Google Chrome', 'version': '100.0.4896.127'}, {'browser_type': 'firefox', 'path': '/Applications/Firefox.app/Contents/MacOS/firefox', 'display_name': 'Firefox', 'version': '99.0.1'}, {'browser_type': 'safari', 'path': '/Applications/Safari.app/Contents/MacOS/Safari', 'display_name': 'Safari', 'version': '15.4'}, {'browser_type': 'opera', 'path': '/Applications/Opera.app/Contents/MacOS/Opera', 'display_name': 'Opera', 'version': '85.0.4341.60'}, {'browser_type': 'msedge', 'path': '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge', 'display_name': 'Microsoft Edge', 'version': '100.1185.22042050'}]
import browsers
print(browsers.get("chrome"))
# {'browser_type': 'chrome', 'path': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 'display_name': 'Google Chrome', 'version': '100.0.4896.127'}
import browsers
browsers.launch("chrome")
import browsers
browsers.launch("chrome", url="https://github.com/roniemartinez/browsers")
import browsers
browsers.launch("chrome", args=["--incognito"])
The get()
and launch()
functions support specifying version in case multiple versions are installed.
Wildcard pattern is also supported.
import browsers
print(browsers.get("chrome", version="100.0.4896.127")) # complete version
# {'browser_type': 'chrome', 'path': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 'display_name': 'Google Chrome', 'version': '100.0.4896.127'}
print(browsers.get("chrome", version="100.*")) # wildcard
# {'browser_type': 'chrome', 'path': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 'display_name': 'Google Chrome', 'version': '100.0.4896.127'}
browsers.launch("chrome", version="100.0.4896.127") # complete version
browsers.launch("chrome", version="100.*") # wildcard
Thanks goes to these wonderful people (emoji key):
Ronie Martinez 💻 🤔 📖 🚧 | Sergey Pirogov 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Python library for detecting and launching browsers
We found that pybrowsers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.