chore: promote Pro tier in first-launch banner, drop header badge

This commit is contained in:
CloakHQ
2026-06-23 03:09:36 +02:00
parent 9c3ed2dcba
commit 8570deaa19
3 changed files with 47 additions and 16 deletions
-4
View File
@@ -14,10 +14,6 @@
<a href="https://hub.docker.com/r/cloakhq/cloakbrowser"><img src="https://img.shields.io/docker/pulls/cloakhq/cloakbrowser?label=docker&logo=docker&logoColor=white" alt="Docker Pulls"></a>
</p>
<p align="center">
<a href="https://ko-fi.com/cloakhq"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support on Ko-fi"></a>
</p>
<br>
<h3 align="center">Stealth Chromium that passes every bot detection test.</h3>
+26 -6
View File
@@ -62,9 +62,18 @@ DOWNLOAD_TIMEOUT = httpx.Timeout(connect=10.0, read=60.0, write=10.0, pool=10.0)
# Auto-update check interval (1 hour)
UPDATE_CHECK_INTERVAL = 3600
# Pro Chromium major shown in the free-tier welcome banner. Bump at each Pro
# major release (there is no local constant to derive it from — the live Pro
# version comes from the network, which we don't call just to print a banner).
PRO_MAJOR = "148"
def _show_welcome() -> None:
"""Show welcome message on first launch. Uses a marker file to show only once."""
def _show_welcome(pro: bool = False) -> None:
"""Show welcome message on first launch. Uses a marker file to show only once.
The Pro-upsell line is shown to free-tier users only; Pro users get a plain
banner (no "running free tier" message, which would be false for them).
"""
marker = get_cache_dir() / ".welcome_shown"
if marker.exists():
return
@@ -72,7 +81,18 @@ def _show_welcome() -> None:
sys.stderr.write(" CloakBrowser — stealth Chromium for automation\n")
sys.stderr.write(" https://github.com/CloakHQ/CloakBrowser\n")
sys.stderr.write("\n")
sys.stderr.write(" Donate? https://ko-fi.com/cloakhq\n")
if pro:
sys.stderr.write(
f" CloakBrowser Pro active (v{PRO_MAJOR}) — latest binary, newest patches.\n"
)
sys.stderr.write(" Pro support → support@cloakbrowser.dev\n")
else:
free_major = CHROMIUM_VERSION.split(".")[0]
sys.stderr.write(
f" Running free tier (v{free_major}). "
f"Pro = latest binary (v{PRO_MAJOR}) + newest anti-bot patches.\n"
)
sys.stderr.write(" Stay ahead of detection → https://cloakbrowser.dev\n")
sys.stderr.write(" Star us if CloakBrowser helps your project!\n")
sys.stderr.write("\n")
try:
@@ -232,7 +252,7 @@ def _ensure_pro_binary(license_key: str) -> str:
if binary_path.exists() and _is_executable(binary_path):
logger.debug("Pro binary found in cache: %s (version %s)", binary_path, effective)
_show_welcome()
_show_welcome(pro=True)
_maybe_trigger_pro_update_check(license_key)
return str(binary_path)
@@ -243,7 +263,7 @@ def _ensure_pro_binary(license_key: str) -> str:
binary_path = get_binary_path(version, pro=True)
if binary_path.exists() and _is_executable(binary_path):
logger.debug("Pro binary found in cache: %s (version %s)", binary_path, version)
_show_welcome()
_show_welcome(pro=True)
return str(binary_path)
logger.info("Downloading Pro Chromium %s for %s...", version, get_platform_tag())
@@ -264,7 +284,7 @@ def _ensure_pro_binary(license_key: str) -> str:
except OSError:
pass
_show_welcome()
_show_welcome(pro=True)
return str(binary_path)
+21 -6
View File
@@ -38,6 +38,10 @@ import { resolveLicenseKey, validateLicense, getProLatestVersion } from "./licen
const DOWNLOAD_TIMEOUT_MS = 600_000; // 10 minutes
const UPDATE_CHECK_INTERVAL_MS = 3_600_000; // 1 hour
// Pro Chromium major shown in the welcome banner. Bump at each Pro major release
// (no local constant to derive it from — the live Pro version comes from the
// network, which we don't call just to print a banner). Mirrors download.py.
const PRO_MAJOR = "148";
/**
* A downloaded binary could not be authenticated (bad/missing signature,
@@ -205,15 +209,26 @@ export async function checkForUpdate(): Promise<string | null> {
// Welcome message (shown once per install)
// ---------------------------------------------------------------------------
function showWelcome(): void {
function showWelcome(pro = false): void {
const marker = path.join(getCacheDir(), ".welcome_shown");
if (fs.existsSync(marker)) return;
console.error();
console.error(" CloakBrowser — stealth Chromium for automation");
console.error(" https://github.com/CloakHQ/CloakBrowser");
console.error();
console.error(" Issues? https://github.com/CloakHQ/CloakBrowser/issues");
console.error(" Donate? https://ko-fi.com/cloakhq");
if (pro) {
console.error(
` CloakBrowser Pro active (v${PRO_MAJOR}) — latest binary, newest patches.`,
);
console.error(" Pro support → support@cloakbrowser.dev");
} else {
const freeMajor = CHROMIUM_VERSION.split(".")[0];
console.error(
` Running free tier (v${freeMajor}). ` +
`Pro = latest binary (v${PRO_MAJOR}) + newest anti-bot patches.`,
);
console.error(" Stay ahead of detection → https://cloakbrowser.dev");
}
console.error(" Star us if CloakBrowser helps your project!");
console.error();
try {
@@ -590,7 +605,7 @@ async function ensureProBinary(licenseKey: string): Promise<string> {
const effectivePath = getBinaryPath(effective, true);
if (fs.existsSync(effectivePath) && isExecutable(effectivePath)) {
showWelcome();
showWelcome(true);
maybeTriggerProUpdateCheck(licenseKey);
return effectivePath;
}
@@ -602,7 +617,7 @@ async function ensureProBinary(licenseKey: string): Promise<string> {
const versionPath = getBinaryPath(version, true);
if (fs.existsSync(versionPath) && isExecutable(versionPath)) {
showWelcome();
showWelcome(true);
return versionPath;
}
@@ -628,7 +643,7 @@ async function ensureProBinary(licenseKey: string): Promise<string> {
// Non-fatal
}
showWelcome();
showWelcome(true);
return downloadedPath;
}