hiddenwb 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hiddenwb-0.1.0/LICENSE +21 -0
- hiddenwb-0.1.0/PKG-INFO +114 -0
- hiddenwb-0.1.0/README.md +88 -0
- hiddenwb-0.1.0/hiddenwb/__init__.py +33 -0
- hiddenwb-0.1.0/hiddenwb/browsers.py +40 -0
- hiddenwb-0.1.0/hiddenwb/cli.py +139 -0
- hiddenwb-0.1.0/hiddenwb/core.py +21 -0
- hiddenwb-0.1.0/hiddenwb/definitions.py +405 -0
- hiddenwb-0.1.0/hiddenwb/detectors.py +362 -0
- hiddenwb-0.1.0/hiddenwb/launcher.py +179 -0
- hiddenwb-0.1.0/hiddenwb/py.typed +0 -0
- hiddenwb-0.1.0/hiddenwb.egg-info/PKG-INFO +114 -0
- hiddenwb-0.1.0/hiddenwb.egg-info/SOURCES.txt +17 -0
- hiddenwb-0.1.0/hiddenwb.egg-info/dependency_links.txt +1 -0
- hiddenwb-0.1.0/hiddenwb.egg-info/entry_points.txt +2 -0
- hiddenwb-0.1.0/hiddenwb.egg-info/top_level.txt +1 -0
- hiddenwb-0.1.0/pyproject.toml +40 -0
- hiddenwb-0.1.0/setup.cfg +4 -0
- hiddenwb-0.1.0/tests/test_hiddenwb.py +34 -0
hiddenwb-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Goplop0959
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
hiddenwb-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hiddenwb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Detect the top web browsers and open links in hidden background (headless) windows.
|
|
5
|
+
Author-email: Goplop0959 <goplop0959@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Goplop0959/hiddenwb
|
|
8
|
+
Project-URL: Repository, https://github.com/Goplop0959/hiddenwb
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/Goplop0959/hiddenwb/issues
|
|
10
|
+
Keywords: browser,hidden,headless,chrome,edge,firefox,brave,opera,webbrowser,background
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: MacOS
|
|
19
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
20
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.12.6
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# hiddenwb
|
|
28
|
+
|
|
29
|
+
**hiddenwb** detects the top web browsers installed on your system and lets you
|
|
30
|
+
open a link in a hidden (headless / background) browser window — without stealing
|
|
31
|
+
focus from your terminal.
|
|
32
|
+
|
|
33
|
+
Supported Python: **3.12.6 and up**.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
* 🔍 **Detects 20+ browsers** across Windows, macOS, and Linux, including:
|
|
38
|
+
* Google Chrome (+ Beta, Canary)
|
|
39
|
+
* Microsoft Edge (+ Beta, Dev, Canary)
|
|
40
|
+
* Mozilla Firefox (+ Developer Edition, Nightly)
|
|
41
|
+
* Brave Browser (+ Beta, Nightly)
|
|
42
|
+
* Opera GX (+ Opera, Opera Beta)
|
|
43
|
+
* Vivaldi (+ Snapshot)
|
|
44
|
+
* Chromium
|
|
45
|
+
* Tor Browser, Waterfox, Pale Moon
|
|
46
|
+
* Safari (macOS)
|
|
47
|
+
* Maxthon, Falkon
|
|
48
|
+
* 🕶️ **Open URLs in hidden background windows** using headless mode
|
|
49
|
+
(`--headless=new` for Chromium, `--headless` for Firefox).
|
|
50
|
+
* 💻 **CLI** (`hiddenwb open`, `hiddenwb detect`, `hiddenwb list`)
|
|
51
|
+
* 📦 **Pure Python**, no external dependencies.
|
|
52
|
+
* 🐍 Python 3.12.6+
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install hiddenwb
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
### Python API
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from hiddenwb import detect_browsers, open_hidden, BrowserNotFoundError
|
|
66
|
+
|
|
67
|
+
# See what's installed
|
|
68
|
+
browsers = detect_browsers()
|
|
69
|
+
print(browsers.keys()) # dict_keys(['chrome', 'edge', 'firefox', ...])
|
|
70
|
+
|
|
71
|
+
# Open a link in a hidden Chrome window
|
|
72
|
+
try:
|
|
73
|
+
proc = open_hidden("https://example.com", key="chrome")
|
|
74
|
+
print(f"Launched (pid {proc.pid})")
|
|
75
|
+
except BrowserNotFoundError:
|
|
76
|
+
print("No supported browser found.")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### CLI
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# List every detected browser
|
|
83
|
+
hiddenwb list
|
|
84
|
+
|
|
85
|
+
# Detect a specific browser
|
|
86
|
+
hiddenwb detect chrome
|
|
87
|
+
|
|
88
|
+
# Open a URL in a hidden Edge window
|
|
89
|
+
hiddenwb open https://example.com --browser edge
|
|
90
|
+
|
|
91
|
+
# Open using the first available browser
|
|
92
|
+
hiddenwb open https://example.com
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## How "hidden" works
|
|
96
|
+
|
|
97
|
+
* Chromium-based browsers (Chrome, Edge, Brave, Opera, Vivaldi, …) launch with
|
|
98
|
+
`--headless=new --disable-gpu --no-sandbox --hide-scrollbars --mute-audio`.
|
|
99
|
+
* Firefox launches with `--headless`.
|
|
100
|
+
* Safari on macOS launches with `open -g` (backgrounded, no focus steal).
|
|
101
|
+
* On Windows the process is detached (`DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP`)
|
|
102
|
+
so it keeps running in the background after your script exits.
|
|
103
|
+
|
|
104
|
+
## Project
|
|
105
|
+
|
|
106
|
+
* **Repository:** https://github.com/Goplop0959/hiddenwb
|
|
107
|
+
* **Author:** Goplop0959
|
|
108
|
+
* **License:** MIT
|
|
109
|
+
|
|
110
|
+
## Disclaimer
|
|
111
|
+
|
|
112
|
+
hiddenwb is intended for legitimate automation and testing use-cases. Respect
|
|
113
|
+
website terms of service and users' privacy. The authors are not responsible for
|
|
114
|
+
how this tool is used.
|
hiddenwb-0.1.0/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# hiddenwb
|
|
2
|
+
|
|
3
|
+
**hiddenwb** detects the top web browsers installed on your system and lets you
|
|
4
|
+
open a link in a hidden (headless / background) browser window — without stealing
|
|
5
|
+
focus from your terminal.
|
|
6
|
+
|
|
7
|
+
Supported Python: **3.12.6 and up**.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
* 🔍 **Detects 20+ browsers** across Windows, macOS, and Linux, including:
|
|
12
|
+
* Google Chrome (+ Beta, Canary)
|
|
13
|
+
* Microsoft Edge (+ Beta, Dev, Canary)
|
|
14
|
+
* Mozilla Firefox (+ Developer Edition, Nightly)
|
|
15
|
+
* Brave Browser (+ Beta, Nightly)
|
|
16
|
+
* Opera GX (+ Opera, Opera Beta)
|
|
17
|
+
* Vivaldi (+ Snapshot)
|
|
18
|
+
* Chromium
|
|
19
|
+
* Tor Browser, Waterfox, Pale Moon
|
|
20
|
+
* Safari (macOS)
|
|
21
|
+
* Maxthon, Falkon
|
|
22
|
+
* 🕶️ **Open URLs in hidden background windows** using headless mode
|
|
23
|
+
(`--headless=new` for Chromium, `--headless` for Firefox).
|
|
24
|
+
* 💻 **CLI** (`hiddenwb open`, `hiddenwb detect`, `hiddenwb list`)
|
|
25
|
+
* 📦 **Pure Python**, no external dependencies.
|
|
26
|
+
* 🐍 Python 3.12.6+
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install hiddenwb
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
### Python API
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from hiddenwb import detect_browsers, open_hidden, BrowserNotFoundError
|
|
40
|
+
|
|
41
|
+
# See what's installed
|
|
42
|
+
browsers = detect_browsers()
|
|
43
|
+
print(browsers.keys()) # dict_keys(['chrome', 'edge', 'firefox', ...])
|
|
44
|
+
|
|
45
|
+
# Open a link in a hidden Chrome window
|
|
46
|
+
try:
|
|
47
|
+
proc = open_hidden("https://example.com", key="chrome")
|
|
48
|
+
print(f"Launched (pid {proc.pid})")
|
|
49
|
+
except BrowserNotFoundError:
|
|
50
|
+
print("No supported browser found.")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### CLI
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# List every detected browser
|
|
57
|
+
hiddenwb list
|
|
58
|
+
|
|
59
|
+
# Detect a specific browser
|
|
60
|
+
hiddenwb detect chrome
|
|
61
|
+
|
|
62
|
+
# Open a URL in a hidden Edge window
|
|
63
|
+
hiddenwb open https://example.com --browser edge
|
|
64
|
+
|
|
65
|
+
# Open using the first available browser
|
|
66
|
+
hiddenwb open https://example.com
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## How "hidden" works
|
|
70
|
+
|
|
71
|
+
* Chromium-based browsers (Chrome, Edge, Brave, Opera, Vivaldi, …) launch with
|
|
72
|
+
`--headless=new --disable-gpu --no-sandbox --hide-scrollbars --mute-audio`.
|
|
73
|
+
* Firefox launches with `--headless`.
|
|
74
|
+
* Safari on macOS launches with `open -g` (backgrounded, no focus steal).
|
|
75
|
+
* On Windows the process is detached (`DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP`)
|
|
76
|
+
so it keeps running in the background after your script exits.
|
|
77
|
+
|
|
78
|
+
## Project
|
|
79
|
+
|
|
80
|
+
* **Repository:** https://github.com/Goplop0959/hiddenwb
|
|
81
|
+
* **Author:** Goplop0959
|
|
82
|
+
* **License:** MIT
|
|
83
|
+
|
|
84
|
+
## Disclaimer
|
|
85
|
+
|
|
86
|
+
hiddenwb is intended for legitimate automation and testing use-cases. Respect
|
|
87
|
+
website terms of service and users' privacy. The authors are not responsible for
|
|
88
|
+
how this tool is used.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""hiddenwb - Detect web browsers and open links in hidden background windows.
|
|
2
|
+
|
|
3
|
+
hiddenwb detects the top web browsers installed on a system (Chrome, Edge,
|
|
4
|
+
Firefox, Brave, Opera GX, and many more) and lets you open a URL in a hidden
|
|
5
|
+
(headless / background) browser window without stealing focus.
|
|
6
|
+
|
|
7
|
+
Supported Python: 3.12.6 and up.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from .core import (
|
|
11
|
+
detect_browsers,
|
|
12
|
+
detect_browser,
|
|
13
|
+
list_browsers,
|
|
14
|
+
open_hidden,
|
|
15
|
+
open_url,
|
|
16
|
+
Browser,
|
|
17
|
+
BrowserNotFoundError,
|
|
18
|
+
HiddenWBError,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__version__ = "0.1.0"
|
|
22
|
+
__author__ = "Goplop0959"
|
|
23
|
+
__all__ = [
|
|
24
|
+
"detect_browsers",
|
|
25
|
+
"detect_browser",
|
|
26
|
+
"list_browsers",
|
|
27
|
+
"open_hidden",
|
|
28
|
+
"open_url",
|
|
29
|
+
"Browser",
|
|
30
|
+
"BrowserNotFoundError",
|
|
31
|
+
"HiddenWBError",
|
|
32
|
+
"__version__",
|
|
33
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Public data model for hiddenwb."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
from typing import List, Optional
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Browser:
|
|
11
|
+
"""Represents a detected web browser installation."""
|
|
12
|
+
|
|
13
|
+
name: str
|
|
14
|
+
"""Human-readable browser name (e.g. ``"Google Chrome"``)."""
|
|
15
|
+
|
|
16
|
+
key: str
|
|
17
|
+
"""Internal identifier key (e.g. ``"chrome"``)."""
|
|
18
|
+
|
|
19
|
+
path: str
|
|
20
|
+
"""Filesystem path to the browser executable."""
|
|
21
|
+
|
|
22
|
+
version: Optional[str] = None
|
|
23
|
+
"""Detected version string, if available."""
|
|
24
|
+
|
|
25
|
+
family: str = "chromium"
|
|
26
|
+
"""Browser engine family: ``chromium``, ``gecko``, ``webkit``, etc."""
|
|
27
|
+
|
|
28
|
+
headless_args: List[str] = field(default_factory=list)
|
|
29
|
+
"""Extra CLI flags to pass when launching this browser headless."""
|
|
30
|
+
|
|
31
|
+
def __repr__(self) -> str: # pragma: no cover - trivial
|
|
32
|
+
return f"Browser(name={self.name!r}, key={self.key!r}, path={self.path!r})"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class HiddenWBError(Exception):
|
|
36
|
+
"""Base exception for hiddenwb errors."""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class BrowserNotFoundError(HiddenWBError):
|
|
40
|
+
"""Raised when no suitable browser can be found for an operation."""
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"""Command-line interface for hiddenwb.
|
|
2
|
+
|
|
3
|
+
Usage::
|
|
4
|
+
|
|
5
|
+
python -m hiddenwb "https://example.com" --browser chrome
|
|
6
|
+
hiddenwb --list-browsers
|
|
7
|
+
hiddenwb --detect
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import argparse
|
|
13
|
+
import json
|
|
14
|
+
import sys
|
|
15
|
+
from typing import List, Optional
|
|
16
|
+
|
|
17
|
+
from .browsers import Browser, BrowserNotFoundError
|
|
18
|
+
from .core import detect_browsers, list_browsers, open_hidden, open_url
|
|
19
|
+
from .detectors import detect_browser
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _format_browser(browser: Browser) -> dict:
|
|
23
|
+
return {
|
|
24
|
+
"name": browser.name,
|
|
25
|
+
"key": browser.key,
|
|
26
|
+
"path": browser.path,
|
|
27
|
+
"version": browser.version,
|
|
28
|
+
"family": browser.family,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def cmd_list(args: argparse.Namespace) -> int:
|
|
33
|
+
browsers = detect_browsers()
|
|
34
|
+
if args.json:
|
|
35
|
+
print(
|
|
36
|
+
json.dumps(
|
|
37
|
+
{key: [_format_browser(b) for b in bs] for key, bs in browsers.items()},
|
|
38
|
+
indent=2,
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
else:
|
|
42
|
+
if not browsers:
|
|
43
|
+
print("No supported browsers detected.")
|
|
44
|
+
return 0
|
|
45
|
+
print("Detected browsers:")
|
|
46
|
+
for key, bs in browsers.items():
|
|
47
|
+
print(f" - {key}:")
|
|
48
|
+
for b in bs:
|
|
49
|
+
ver = f" ({b.version})" if b.version else ""
|
|
50
|
+
print(f" {b.name}{ver} -> {b.path}")
|
|
51
|
+
return 0
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def cmd_detect(args: argparse.Namespace) -> int:
|
|
55
|
+
key = args.browser
|
|
56
|
+
if key:
|
|
57
|
+
browser = detect_browser(key)
|
|
58
|
+
if browser is None:
|
|
59
|
+
print(f"Browser '{key}' not installed.")
|
|
60
|
+
return 1
|
|
61
|
+
print(json.dumps(_format_browser(browser), indent=2))
|
|
62
|
+
return 0
|
|
63
|
+
browsers = detect_browsers()
|
|
64
|
+
if args.json:
|
|
65
|
+
print(
|
|
66
|
+
json.dumps(
|
|
67
|
+
{k: [_format_browser(b) for b in bs] for k, bs in browsers.items()},
|
|
68
|
+
indent=2,
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
else:
|
|
72
|
+
if not browsers:
|
|
73
|
+
print("No supported browsers detected.")
|
|
74
|
+
else:
|
|
75
|
+
print(f"{sum(len(v) for v in browsers.values())} browser installation(s) detected across {len(browsers)} family(ies).")
|
|
76
|
+
return 0
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def cmd_open(args: argparse.Namespace) -> int:
|
|
80
|
+
try:
|
|
81
|
+
open_hidden(args.url, key=args.browser, check=True, background=not args.foreground)
|
|
82
|
+
except BrowserNotFoundError as exc:
|
|
83
|
+
print(f"Error: {exc}", file=sys.stderr)
|
|
84
|
+
if args.fallback:
|
|
85
|
+
print("Falling back to system default browser (visible)...")
|
|
86
|
+
open_url(args.url)
|
|
87
|
+
return 0
|
|
88
|
+
return 1
|
|
89
|
+
target = args.browser or "default available"
|
|
90
|
+
print(f"Opened {args.url} in hidden window via {target}.")
|
|
91
|
+
return 0
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
95
|
+
parser = argparse.ArgumentParser(
|
|
96
|
+
prog="hiddenwb",
|
|
97
|
+
description="Open links in hidden background browser windows.",
|
|
98
|
+
)
|
|
99
|
+
sub = parser.add_subparsers(dest="command", required=True)
|
|
100
|
+
|
|
101
|
+
p_list = sub.add_parser("list", help="List detected browsers.")
|
|
102
|
+
p_list.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
103
|
+
p_list.set_defaults(func=cmd_list)
|
|
104
|
+
|
|
105
|
+
p_detect = sub.add_parser("detect", help="Detect installed browsers.")
|
|
106
|
+
p_detect.add_argument("browser", nargs="?", help="Specific browser key to check.")
|
|
107
|
+
p_detect.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
108
|
+
p_detect.set_defaults(func=cmd_detect)
|
|
109
|
+
|
|
110
|
+
p_open = sub.add_parser("open", help="Open a URL in a hidden window.")
|
|
111
|
+
p_open.add_argument("url", help="URL to open.")
|
|
112
|
+
p_open.add_argument(
|
|
113
|
+
"--browser",
|
|
114
|
+
"-b",
|
|
115
|
+
help="Browser key to use (e.g. chrome, edge, firefox).",
|
|
116
|
+
)
|
|
117
|
+
p_open.add_argument(
|
|
118
|
+
"--foreground",
|
|
119
|
+
action="store_true",
|
|
120
|
+
help="Do not detach the browser (run in foreground).",
|
|
121
|
+
)
|
|
122
|
+
p_open.add_argument(
|
|
123
|
+
"--fallback",
|
|
124
|
+
action="store_true",
|
|
125
|
+
help="Fall back to the visible default browser if none found.",
|
|
126
|
+
)
|
|
127
|
+
p_open.set_defaults(func=cmd_open)
|
|
128
|
+
|
|
129
|
+
return parser
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def main(argv: Optional[List[str]] = None) -> int:
|
|
133
|
+
parser = build_parser()
|
|
134
|
+
args = parser.parse_args(argv)
|
|
135
|
+
return args.func(args)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
if __name__ == "__main__":
|
|
139
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Core public API for hiddenwb."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, List, Optional
|
|
6
|
+
|
|
7
|
+
from .browsers import Browser, BrowserNotFoundError, HiddenWBError
|
|
8
|
+
from .detectors import detect_browser, detect_browsers, list_browsers
|
|
9
|
+
from .launcher import open_hidden, open_url
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"detect_browsers",
|
|
14
|
+
"detect_browser",
|
|
15
|
+
"list_browsers",
|
|
16
|
+
"open_hidden",
|
|
17
|
+
"open_url",
|
|
18
|
+
"Browser",
|
|
19
|
+
"BrowserNotFoundError",
|
|
20
|
+
"HiddenWBError",
|
|
21
|
+
]
|