bb-browser 0.1.0 → 0.1.2
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/{chunk-KATHFDYJ.js → chunk-YAVLEXUJ.js} +1 -1
- package/dist/chunk-YAVLEXUJ.js.map +1 -0
- package/dist/cli.js +118 -58
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1 -1
- package/extension/background.js +23 -13
- package/extension/background.js.map +1 -1
- package/extension/dist/background.js +162 -98
- package/extension/dist/background.js.map +1 -1
- package/extension/dist/manifest.json +1 -1
- package/package.json +1 -1
- package/dist/chunk-KATHFDYJ.js.map +0 -1
package/dist/daemon.js
CHANGED
package/extension/background.js
CHANGED
|
@@ -2344,23 +2344,30 @@ async function handleTabNew(command) {
|
|
|
2344
2344
|
}
|
|
2345
2345
|
async function handleTabSelect(command) {
|
|
2346
2346
|
const index = command.index;
|
|
2347
|
-
|
|
2347
|
+
const tabIdParam = command.tabId;
|
|
2348
|
+
if (index === void 0 && tabIdParam === void 0) {
|
|
2348
2349
|
return {
|
|
2349
2350
|
id: command.id,
|
|
2350
2351
|
success: false,
|
|
2351
|
-
error: "Missing or
|
|
2352
|
+
error: "Missing index or tabId parameter"
|
|
2352
2353
|
};
|
|
2353
2354
|
}
|
|
2354
|
-
console.log("[CommandHandler] Selecting tab
|
|
2355
|
+
console.log("[CommandHandler] Selecting tab:", tabIdParam !== void 0 ? `tabId=${tabIdParam}` : `index=${index}`);
|
|
2355
2356
|
try {
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2357
|
+
let targetTab;
|
|
2358
|
+
if (tabIdParam !== void 0) {
|
|
2359
|
+
targetTab = await chrome.tabs.get(tabIdParam);
|
|
2360
|
+
} else {
|
|
2361
|
+
const tabs = await chrome.tabs.query({ currentWindow: true });
|
|
2362
|
+
const found = tabs.find((t) => t.index === index);
|
|
2363
|
+
if (!found || !found.id) {
|
|
2364
|
+
return {
|
|
2365
|
+
id: command.id,
|
|
2366
|
+
success: false,
|
|
2367
|
+
error: `No tab found at index ${index} (total tabs: ${tabs.length})`
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
targetTab = found;
|
|
2364
2371
|
}
|
|
2365
2372
|
await chrome.tabs.update(targetTab.id, { active: true });
|
|
2366
2373
|
return {
|
|
@@ -2383,10 +2390,13 @@ async function handleTabSelect(command) {
|
|
|
2383
2390
|
}
|
|
2384
2391
|
async function handleTabClose(command) {
|
|
2385
2392
|
const index = command.index;
|
|
2386
|
-
|
|
2393
|
+
const tabIdParam = command.tabId;
|
|
2394
|
+
console.log("[CommandHandler] Closing tab:", tabIdParam !== void 0 ? `tabId=${tabIdParam}` : index !== void 0 ? `index=${index}` : "current");
|
|
2387
2395
|
try {
|
|
2388
2396
|
let targetTab;
|
|
2389
|
-
if (
|
|
2397
|
+
if (tabIdParam !== void 0) {
|
|
2398
|
+
targetTab = await chrome.tabs.get(tabIdParam);
|
|
2399
|
+
} else if (index !== void 0) {
|
|
2390
2400
|
const tabs = await chrome.tabs.query({ currentWindow: true });
|
|
2391
2401
|
const found = tabs.find((t) => t.index === index);
|
|
2392
2402
|
if (!found || !found.id) {
|