fix: open-browser enable session restore (v2.0.26)
All checks were successful
技能自动化发布 / release (push) Successful in 8s
All checks were successful
技能自动化发布 / release (push) Successful in 8s
This commit is contained in:
@@ -14,6 +14,7 @@ import sys
|
||||
|
||||
from db.connection import get_conn, init_db
|
||||
from db.accounts_repo import get_account_by_id, get_platform_from_db
|
||||
from service.chrome_profile_prefs import ensure_session_restore
|
||||
from util.logging_config import get_skill_logger
|
||||
from util.platforms import PLATFORMS
|
||||
|
||||
@@ -225,6 +226,10 @@ def cmd_open(account_id):
|
||||
profile_abs = os.path.abspath(profile_dir)
|
||||
os.makedirs(profile_abs, exist_ok=True)
|
||||
|
||||
# 独立 Profile 默认不会「继续上次会话」,Session Cookie 关窗即丢;打开前写入 Preferences
|
||||
prefs_result = ensure_session_restore(profile_abs)
|
||||
log.info("browser_open_prefs %s", prefs_result)
|
||||
|
||||
conn = get_conn()
|
||||
try:
|
||||
url = resolve_account_browser_url(target, conn=conn)
|
||||
@@ -235,11 +240,12 @@ def cmd_open(account_id):
|
||||
cmd = [browser_exe, *human_chrome_launch_args(profile_abs, url)]
|
||||
|
||||
log.info(
|
||||
"browser_open_launch exe=%s profile_dir=%s url=%s platform=%s",
|
||||
"browser_open_launch exe=%s profile_dir=%s url=%s platform=%s restore_on_startup=%s",
|
||||
browser_exe,
|
||||
profile_abs,
|
||||
url,
|
||||
target.get("platform_key"),
|
||||
prefs_result.get("restore_after"),
|
||||
)
|
||||
|
||||
try:
|
||||
@@ -289,6 +295,7 @@ def cmd_open(account_id):
|
||||
"profile_dir": profile_abs,
|
||||
"url": url,
|
||||
"pid": child.pid,
|
||||
"session_restore_on_startup": prefs_result.get("restore_after"),
|
||||
},
|
||||
},
|
||||
ensure_ascii=False,
|
||||
|
||||
Reference in New Issue
Block a user