@xbrowser/cli 1.9.4 → 1.9.5

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.
package/dist/cli.js CHANGED
@@ -6333,6 +6333,22 @@ async function checkPluginLoginRequired(options) {
6333
6333
  const requiresLogin = command.requiresLogin === true || site.config?.requiresLogin === true || loginConfig?.requiresLogin === true || command.loginRequired === "required";
6334
6334
  if (!requiresLogin) return { ok: true };
6335
6335
  const pluginName = site.name || "plugin";
6336
+ const siteConfig = site.config;
6337
+ const configIsLogin = siteConfig?.isLogin;
6338
+ if (configIsLogin) {
6339
+ try {
6340
+ const loggedIn = await configIsLogin(ctx);
6341
+ if (loggedIn) return { ok: true };
6342
+ return buildLoginRequired({
6343
+ plugin: pluginName,
6344
+ command: commandName,
6345
+ reason: "config.isLogin returned false",
6346
+ sessionName,
6347
+ loginConfig
6348
+ });
6349
+ } catch {
6350
+ }
6351
+ }
6336
6352
  if (typeof site.isLoggedIn === "function") {
6337
6353
  try {
6338
6354
  const loggedIn = await site.isLoggedIn(ctx);
@@ -5850,6 +5850,22 @@ async function checkPluginLoginRequired(options) {
5850
5850
  const requiresLogin = command.requiresLogin === true || site.config?.requiresLogin === true || loginConfig?.requiresLogin === true || command.loginRequired === "required";
5851
5851
  if (!requiresLogin) return { ok: true };
5852
5852
  const pluginName = site.name || "plugin";
5853
+ const siteConfig = site.config;
5854
+ const configIsLogin = siteConfig?.isLogin;
5855
+ if (configIsLogin) {
5856
+ try {
5857
+ const loggedIn = await configIsLogin(ctx);
5858
+ if (loggedIn) return { ok: true };
5859
+ return buildLoginRequired({
5860
+ plugin: pluginName,
5861
+ command: commandName,
5862
+ reason: "config.isLogin returned false",
5863
+ sessionName,
5864
+ loginConfig
5865
+ });
5866
+ } catch {
5867
+ }
5868
+ }
5853
5869
  if (typeof site.isLoggedIn === "function") {
5854
5870
  try {
5855
5871
  const loggedIn = await site.isLoggedIn(ctx);
package/dist/index.js CHANGED
@@ -6678,6 +6678,22 @@ async function checkPluginLoginRequired(options) {
6678
6678
  const requiresLogin = command.requiresLogin === true || site.config?.requiresLogin === true || loginConfig?.requiresLogin === true || command.loginRequired === "required";
6679
6679
  if (!requiresLogin) return { ok: true };
6680
6680
  const pluginName = site.name || "plugin";
6681
+ const siteConfig = site.config;
6682
+ const configIsLogin = siteConfig?.isLogin;
6683
+ if (configIsLogin) {
6684
+ try {
6685
+ const loggedIn = await configIsLogin(ctx);
6686
+ if (loggedIn) return { ok: true };
6687
+ return buildLoginRequired({
6688
+ plugin: pluginName,
6689
+ command: commandName,
6690
+ reason: "config.isLogin returned false",
6691
+ sessionName,
6692
+ loginConfig
6693
+ });
6694
+ } catch {
6695
+ }
6696
+ }
6681
6697
  if (typeof site.isLoggedIn === "function") {
6682
6698
  try {
6683
6699
  const loggedIn = await site.isLoggedIn(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xbrowser/cli",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Browser automation CLI for web scraping, headless browsing, SEO analysis, and AI agent workflows. A command-line alternative to Playwright, Puppeteer, and Selenium.",
5
5
  "type": "module",
6
6
  "bin": {