@opentabs-dev/browser-extension 0.0.63 → 0.0.65
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/background-message-handlers.d.ts +5 -1
- package/dist/background-message-handlers.d.ts.map +1 -1
- package/dist/background-message-handlers.js +82 -2
- package/dist/background-message-handlers.js.map +1 -1
- package/dist/background.js +283 -140
- package/dist/browser-commands/interaction-commands.d.ts +2 -0
- package/dist/browser-commands/interaction-commands.d.ts.map +1 -1
- package/dist/browser-commands/interaction-commands.js +26 -3
- package/dist/browser-commands/interaction-commands.js.map +1 -1
- package/dist/browser-commands/key-press-command.d.ts +6 -0
- package/dist/browser-commands/key-press-command.d.ts.map +1 -1
- package/dist/browser-commands/key-press-command.js +137 -118
- package/dist/browser-commands/key-press-command.js.map +1 -1
- package/dist/dispatch-helpers.js +2 -2
- package/dist/dispatch-helpers.js.map +1 -1
- package/dist/extension-messages.d.ts +13 -1
- package/dist/extension-messages.d.ts.map +1 -1
- package/dist/iife-injection.d.ts +5 -4
- package/dist/iife-injection.d.ts.map +1 -1
- package/dist/iife-injection.js +21 -12
- package/dist/iife-injection.js.map +1 -1
- package/dist/message-router.d.ts +2 -0
- package/dist/message-router.d.ts.map +1 -1
- package/dist/message-router.js +16 -4
- package/dist/message-router.js.map +1 -1
- package/dist/offscreen/index.js +1 -0
- package/dist/offscreen/index.js.map +1 -1
- package/dist/side-panel/App.d.ts.map +1 -1
- package/dist/side-panel/App.js +46 -4
- package/dist/side-panel/App.js.map +1 -1
- package/dist/side-panel/bridge.d.ts +7 -1
- package/dist/side-panel/bridge.d.ts.map +1 -1
- package/dist/side-panel/bridge.js +5 -1
- package/dist/side-panel/bridge.js.map +1 -1
- package/dist/side-panel/components/BrowserToolsCard.d.ts.map +1 -1
- package/dist/side-panel/components/BrowserToolsCard.js +6 -27
- package/dist/side-panel/components/BrowserToolsCard.js.map +1 -1
- package/dist/side-panel/components/ConfirmationDialog.d.ts.map +1 -1
- package/dist/side-panel/components/ConfirmationDialog.js +2 -1
- package/dist/side-panel/components/ConfirmationDialog.js.map +1 -1
- package/dist/side-panel/components/EmptyStates.d.ts.map +1 -1
- package/dist/side-panel/components/EmptyStates.js +17 -3
- package/dist/side-panel/components/EmptyStates.js.map +1 -1
- package/dist/side-panel/components/FailedPluginCard.d.ts +6 -2
- package/dist/side-panel/components/FailedPluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/FailedPluginCard.js +11 -3
- package/dist/side-panel/components/FailedPluginCard.js.map +1 -1
- package/dist/side-panel/components/NpmPluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/NpmPluginCard.js +1 -1
- package/dist/side-panel/components/NpmPluginCard.js.map +1 -1
- package/dist/side-panel/components/PluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/PluginCard.js +33 -34
- package/dist/side-panel/components/PluginCard.js.map +1 -1
- package/dist/side-panel/components/PluginList.d.ts +4 -2
- package/dist/side-panel/components/PluginList.d.ts.map +1 -1
- package/dist/side-panel/components/PluginList.js +39 -5
- package/dist/side-panel/components/PluginList.js.map +1 -1
- package/dist/side-panel/components/PluginMenu.d.ts +3 -1
- package/dist/side-panel/components/PluginMenu.d.ts.map +1 -1
- package/dist/side-panel/components/PluginMenu.js +2 -2
- package/dist/side-panel/components/PluginMenu.js.map +1 -1
- package/dist/side-panel/components/SearchResults.d.ts +5 -1
- package/dist/side-panel/components/SearchResults.d.ts.map +1 -1
- package/dist/side-panel/components/SearchResults.js +5 -4
- package/dist/side-panel/components/SearchResults.js.map +1 -1
- package/dist/side-panel/components/ToolRow.d.ts +6 -2
- package/dist/side-panel/components/ToolRow.d.ts.map +1 -1
- package/dist/side-panel/components/ToolRow.js +9 -3
- package/dist/side-panel/components/ToolRow.js.map +1 -1
- package/dist/side-panel/components/retro/Button.d.ts +1 -1
- package/dist/side-panel/components/retro/Loader.d.ts +1 -1
- package/dist/side-panel/components/retro/Loader.d.ts.map +1 -1
- package/dist/side-panel/components/retro/Loader.js +1 -0
- package/dist/side-panel/components/retro/Loader.js.map +1 -1
- package/dist/side-panel/components/storybook-helpers.d.ts +13 -0
- package/dist/side-panel/components/storybook-helpers.d.ts.map +1 -0
- package/dist/side-panel/components/storybook-helpers.js +55 -0
- package/dist/side-panel/components/storybook-helpers.js.map +1 -0
- package/dist/side-panel/components/tool-groups.d.ts +16 -0
- package/dist/side-panel/components/tool-groups.d.ts.map +1 -0
- package/dist/side-panel/components/tool-groups.js +31 -0
- package/dist/side-panel/components/tool-groups.js.map +1 -0
- package/dist/side-panel/constants.d.ts +1 -1
- package/dist/side-panel/constants.js +1 -1
- package/dist/side-panel/side-panel.js +2301 -1645
- package/dist/side-panel/styles.css +1 -1
- package/dist/tab-matching.d.ts +5 -3
- package/dist/tab-matching.d.ts.map +1 -1
- package/dist/tab-matching.js +27 -9
- package/dist/tab-matching.js.map +1 -1
- package/dist/tab-state.js +2 -2
- package/dist/tab-state.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -1
package/dist/background.js
CHANGED
|
@@ -1157,12 +1157,23 @@ var invalidatePluginCache = () => {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
|
|
1159
1159
|
// dist/tab-matching.js
|
|
1160
|
-
var urlMatchesPatterns = (url, patterns) => {
|
|
1160
|
+
var urlMatchesPatterns = (url, patterns, excludePatterns) => {
|
|
1161
|
+
let matched = false;
|
|
1161
1162
|
for (const pattern of patterns) {
|
|
1162
|
-
if (matchPattern(url, pattern))
|
|
1163
|
-
|
|
1163
|
+
if (matchPattern(url, pattern)) {
|
|
1164
|
+
matched = true;
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
if (!matched)
|
|
1169
|
+
return false;
|
|
1170
|
+
if (excludePatterns) {
|
|
1171
|
+
for (const pattern of excludePatterns) {
|
|
1172
|
+
if (matchPattern(url, pattern))
|
|
1173
|
+
return false;
|
|
1174
|
+
}
|
|
1164
1175
|
}
|
|
1165
|
-
return
|
|
1176
|
+
return true;
|
|
1166
1177
|
};
|
|
1167
1178
|
var matchPattern = (url, pattern) => {
|
|
1168
1179
|
const matchResult = pattern.match(/^(\*|https?|ftp):\/\/(.+?)(\/.*)$/);
|
|
@@ -1227,8 +1238,10 @@ var findAllMatchingTabs = async (plugin) => {
|
|
|
1227
1238
|
}
|
|
1228
1239
|
}
|
|
1229
1240
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1241
|
+
const excludePatterns = plugin.excludePatterns ?? [];
|
|
1242
|
+
const filtered = excludePatterns.length > 0 ? allMatches.filter((tab) => !tab.url || !urlMatchesPatterns(tab.url, excludePatterns)) : allMatches;
|
|
1243
|
+
if (filtered.length <= 1)
|
|
1244
|
+
return filtered;
|
|
1232
1245
|
let focusedWindowId;
|
|
1233
1246
|
try {
|
|
1234
1247
|
const focusedWindow = await chrome.windows.getLastFocused();
|
|
@@ -1245,7 +1258,7 @@ var findAllMatchingTabs = async (plugin) => {
|
|
|
1245
1258
|
return 1;
|
|
1246
1259
|
return 0;
|
|
1247
1260
|
};
|
|
1248
|
-
return
|
|
1261
|
+
return filtered.slice().sort((a, b) => rank(b) - rank(a));
|
|
1249
1262
|
};
|
|
1250
1263
|
|
|
1251
1264
|
// dist/tab-state.js
|
|
@@ -1483,7 +1496,7 @@ var checkTabChanged = async (changedTabId, changeInfo) => {
|
|
|
1483
1496
|
if (changeInfo.url) {
|
|
1484
1497
|
const changedUrl = changeInfo.url;
|
|
1485
1498
|
affectedPlugins = plugins.filter((p) => {
|
|
1486
|
-
if (urlMatchesPatterns(changedUrl, p.urlPatterns))
|
|
1499
|
+
if (urlMatchesPatterns(changedUrl, p.urlPatterns, p.excludePatterns))
|
|
1487
1500
|
return true;
|
|
1488
1501
|
const cached = lastKnownState.get(p.name);
|
|
1489
1502
|
return cached !== void 0 && getAggregateState(cached) !== "closed";
|
|
@@ -1499,7 +1512,7 @@ var checkTabChanged = async (changedTabId, changeInfo) => {
|
|
|
1499
1512
|
if (!tabUrl)
|
|
1500
1513
|
return;
|
|
1501
1514
|
affectedPlugins = plugins.filter((p) => {
|
|
1502
|
-
if (urlMatchesPatterns(tabUrl, p.urlPatterns))
|
|
1515
|
+
if (urlMatchesPatterns(tabUrl, p.urlPatterns, p.excludePatterns))
|
|
1503
1516
|
return true;
|
|
1504
1517
|
const cached = lastKnownState.get(p.name);
|
|
1505
1518
|
return cached !== void 0 && getAggregateState(cached) !== "closed";
|
|
@@ -2075,11 +2088,12 @@ var handleBrowserClickElement = async (params, id) => {
|
|
|
2075
2088
|
const el = document.querySelector(sel);
|
|
2076
2089
|
if (!el)
|
|
2077
2090
|
return { error: `Element not found: ${sel}` };
|
|
2078
|
-
el.
|
|
2091
|
+
const rect = el.getBoundingClientRect();
|
|
2079
2092
|
return {
|
|
2080
|
-
clicked: true,
|
|
2081
2093
|
tagName: el.tagName.toLowerCase(),
|
|
2082
|
-
text: (el.textContent || "").trim().slice(0, maxPreview)
|
|
2094
|
+
text: (el.textContent || "").trim().slice(0, maxPreview),
|
|
2095
|
+
x: rect.left + rect.width / 2,
|
|
2096
|
+
y: rect.top + rect.height / 2
|
|
2083
2097
|
};
|
|
2084
2098
|
},
|
|
2085
2099
|
args: [selector, TEXT_PREVIEW_MAX_LENGTH]
|
|
@@ -2087,7 +2101,27 @@ var handleBrowserClickElement = async (params, id) => {
|
|
|
2087
2101
|
const result = extractScriptResult(results, id);
|
|
2088
2102
|
if (!result)
|
|
2089
2103
|
return;
|
|
2090
|
-
|
|
2104
|
+
const x = result.x;
|
|
2105
|
+
const y = result.y;
|
|
2106
|
+
await withDebugger(tabId, async () => {
|
|
2107
|
+
await chrome.debugger.sendCommand({ tabId }, "Input.dispatchMouseEvent", {
|
|
2108
|
+
type: "mousePressed",
|
|
2109
|
+
x,
|
|
2110
|
+
y,
|
|
2111
|
+
button: "left",
|
|
2112
|
+
buttons: 1,
|
|
2113
|
+
clickCount: 1
|
|
2114
|
+
});
|
|
2115
|
+
await chrome.debugger.sendCommand({ tabId }, "Input.dispatchMouseEvent", {
|
|
2116
|
+
type: "mouseReleased",
|
|
2117
|
+
x,
|
|
2118
|
+
y,
|
|
2119
|
+
button: "left",
|
|
2120
|
+
buttons: 0,
|
|
2121
|
+
clickCount: 1
|
|
2122
|
+
});
|
|
2123
|
+
});
|
|
2124
|
+
sendSuccessResult(id, { clicked: true, tagName: result.tagName, text: result.text });
|
|
2091
2125
|
} catch (err2) {
|
|
2092
2126
|
sendErrorResult(id, err2);
|
|
2093
2127
|
}
|
|
@@ -2428,6 +2462,57 @@ var UNSHIFTED_PUNCTUATION_CODES = {
|
|
|
2428
2462
|
"/": "Slash",
|
|
2429
2463
|
"`": "Backquote"
|
|
2430
2464
|
};
|
|
2465
|
+
var NAMED_KEY_CODES = {
|
|
2466
|
+
Enter: 13,
|
|
2467
|
+
Escape: 27,
|
|
2468
|
+
Tab: 9,
|
|
2469
|
+
Backspace: 8,
|
|
2470
|
+
Delete: 46,
|
|
2471
|
+
ArrowUp: 38,
|
|
2472
|
+
ArrowDown: 40,
|
|
2473
|
+
ArrowLeft: 37,
|
|
2474
|
+
ArrowRight: 39,
|
|
2475
|
+
Home: 36,
|
|
2476
|
+
End: 35,
|
|
2477
|
+
PageUp: 33,
|
|
2478
|
+
PageDown: 34,
|
|
2479
|
+
" ": 32,
|
|
2480
|
+
F1: 112,
|
|
2481
|
+
F2: 113,
|
|
2482
|
+
F3: 114,
|
|
2483
|
+
F4: 115,
|
|
2484
|
+
F5: 116,
|
|
2485
|
+
F6: 117,
|
|
2486
|
+
F7: 118,
|
|
2487
|
+
F8: 119,
|
|
2488
|
+
F9: 120,
|
|
2489
|
+
F10: 121,
|
|
2490
|
+
F11: 122,
|
|
2491
|
+
F12: 123,
|
|
2492
|
+
Insert: 45
|
|
2493
|
+
};
|
|
2494
|
+
var deriveCode = (key) => {
|
|
2495
|
+
if (key.length === 1) {
|
|
2496
|
+
const upper = key.toUpperCase();
|
|
2497
|
+
if (upper >= "A" && upper <= "Z")
|
|
2498
|
+
return `Key${upper}`;
|
|
2499
|
+
if (key >= "0" && key <= "9")
|
|
2500
|
+
return `Digit${key}`;
|
|
2501
|
+
if (key === " ")
|
|
2502
|
+
return "Space";
|
|
2503
|
+
return SHIFTED_PUNCTUATION_CODES[key] ?? UNSHIFTED_PUNCTUATION_CODES[key] ?? key;
|
|
2504
|
+
}
|
|
2505
|
+
return key;
|
|
2506
|
+
};
|
|
2507
|
+
var getVirtualKeyCode = (key) => {
|
|
2508
|
+
if (NAMED_KEY_CODES[key] !== void 0)
|
|
2509
|
+
return NAMED_KEY_CODES[key];
|
|
2510
|
+
if (key.length === 1)
|
|
2511
|
+
return key.toUpperCase().charCodeAt(0);
|
|
2512
|
+
return 0;
|
|
2513
|
+
};
|
|
2514
|
+
var buildModifiers = (shift, ctrl, alt, meta) => (alt ? 1 : 0) | (ctrl ? 2 : 0) | (meta ? 4 : 0) | (shift ? 8 : 0);
|
|
2515
|
+
var isPrintableKeyPress = (key, ctrl, meta) => key.length === 1 && !ctrl && !meta;
|
|
2431
2516
|
var handleBrowserPressKey = async (params, id) => {
|
|
2432
2517
|
try {
|
|
2433
2518
|
const tabId = requireTabId(params, id);
|
|
@@ -2442,119 +2527,79 @@ var handleBrowserPressKey = async (params, id) => {
|
|
|
2442
2527
|
const ctrlKey = modifiers.ctrl === true;
|
|
2443
2528
|
const altKey = modifiers.alt === true;
|
|
2444
2529
|
const metaKey = modifiers.meta === true;
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
if (!
|
|
2530
|
+
let focusTarget;
|
|
2531
|
+
if (selector) {
|
|
2532
|
+
const focusResults = await chrome.scripting.executeScript({
|
|
2533
|
+
target: { tabId },
|
|
2534
|
+
world: "MAIN",
|
|
2535
|
+
func: (sel) => {
|
|
2536
|
+
const el = document.querySelector(sel);
|
|
2537
|
+
if (!el)
|
|
2453
2538
|
return { error: `Element not found: ${sel}` };
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
};
|
|
2487
|
-
const getKeyCode = (k2) => {
|
|
2488
|
-
if (KEY_CODES[k2] !== void 0)
|
|
2489
|
-
return KEY_CODES[k2];
|
|
2490
|
-
if (k2.length === 1)
|
|
2491
|
-
return k2.toUpperCase().charCodeAt(0);
|
|
2492
|
-
return 0;
|
|
2493
|
-
};
|
|
2494
|
-
const code = deriveCode(k);
|
|
2495
|
-
const keyCode = getKeyCode(k);
|
|
2496
|
-
const isPrintable = k.length === 1;
|
|
2497
|
-
const eventInit = {
|
|
2498
|
-
key: k,
|
|
2539
|
+
el.focus();
|
|
2540
|
+
return {
|
|
2541
|
+
tagName: el.tagName.toLowerCase(),
|
|
2542
|
+
id: el.id || void 0
|
|
2543
|
+
};
|
|
2544
|
+
},
|
|
2545
|
+
args: [selector]
|
|
2546
|
+
});
|
|
2547
|
+
const focusResult = extractScriptResult(focusResults, id);
|
|
2548
|
+
if (!focusResult)
|
|
2549
|
+
return;
|
|
2550
|
+
focusTarget = { tagName: focusResult.tagName, id: focusResult.id };
|
|
2551
|
+
}
|
|
2552
|
+
const code = deriveCode(key);
|
|
2553
|
+
const windowsVirtualKeyCode = getVirtualKeyCode(key);
|
|
2554
|
+
const cdpModifiers = buildModifiers(shiftKey, ctrlKey, altKey, metaKey);
|
|
2555
|
+
const printable = isPrintableKeyPress(key, ctrlKey, metaKey);
|
|
2556
|
+
const text = printable ? key : key === "Enter" ? "\r" : key === "Tab" ? " " : "";
|
|
2557
|
+
await withDebugger(tabId, async () => {
|
|
2558
|
+
await chrome.debugger.sendCommand({ tabId }, "Input.dispatchKeyEvent", {
|
|
2559
|
+
type: printable ? "keyDown" : "rawKeyDown",
|
|
2560
|
+
modifiers: cdpModifiers,
|
|
2561
|
+
windowsVirtualKeyCode,
|
|
2562
|
+
code,
|
|
2563
|
+
key,
|
|
2564
|
+
text: printable ? text : ""
|
|
2565
|
+
});
|
|
2566
|
+
if (printable) {
|
|
2567
|
+
await chrome.debugger.sendCommand({ tabId }, "Input.dispatchKeyEvent", {
|
|
2568
|
+
type: "char",
|
|
2569
|
+
modifiers: cdpModifiers,
|
|
2570
|
+
windowsVirtualKeyCode: key.charCodeAt(0),
|
|
2499
2571
|
code,
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
target.dispatchEvent(new KeyboardEvent("keypress", eventInit));
|
|
2512
|
-
}
|
|
2513
|
-
target.dispatchEvent(new KeyboardEvent("keyup", eventInit));
|
|
2514
|
-
if (isPrintable) {
|
|
2515
|
-
const tag = target.tagName.toLowerCase();
|
|
2516
|
-
const isEditable = tag === "input" || tag === "textarea" || target.isContentEditable;
|
|
2517
|
-
if (isEditable) {
|
|
2518
|
-
if (tag === "input" || tag === "textarea") {
|
|
2519
|
-
const input = target;
|
|
2520
|
-
const start = input.selectionStart ?? input.value.length;
|
|
2521
|
-
const end = input.selectionEnd ?? start;
|
|
2522
|
-
input.value = input.value.slice(0, start) + k + input.value.slice(end);
|
|
2523
|
-
input.selectionStart = input.selectionEnd = start + 1;
|
|
2524
|
-
} else {
|
|
2525
|
-
const selection = window.getSelection();
|
|
2526
|
-
if (selection && selection.rangeCount > 0) {
|
|
2527
|
-
const range = selection.getRangeAt(0);
|
|
2528
|
-
range.deleteContents();
|
|
2529
|
-
range.insertNode(document.createTextNode(k));
|
|
2530
|
-
range.collapse(false);
|
|
2531
|
-
selection.removeAllRanges();
|
|
2532
|
-
selection.addRange(range);
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
target.dispatchEvent(new InputEvent("input", {
|
|
2536
|
-
bubbles: true,
|
|
2537
|
-
cancelable: true,
|
|
2538
|
-
inputType: "insertText",
|
|
2539
|
-
data: k
|
|
2540
|
-
}));
|
|
2541
|
-
}
|
|
2542
|
-
}
|
|
2543
|
-
return {
|
|
2544
|
-
pressed: true,
|
|
2545
|
-
key: k,
|
|
2546
|
-
target: {
|
|
2547
|
-
tagName: target.tagName.toLowerCase(),
|
|
2548
|
-
id: target.id || void 0
|
|
2549
|
-
}
|
|
2550
|
-
};
|
|
2551
|
-
},
|
|
2552
|
-
args: [key, selector, shiftKey, ctrlKey, altKey, metaKey, SHIFTED_PUNCTUATION_CODES, UNSHIFTED_PUNCTUATION_CODES]
|
|
2572
|
+
key,
|
|
2573
|
+
text
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
await chrome.debugger.sendCommand({ tabId }, "Input.dispatchKeyEvent", {
|
|
2577
|
+
type: "keyUp",
|
|
2578
|
+
modifiers: cdpModifiers,
|
|
2579
|
+
windowsVirtualKeyCode,
|
|
2580
|
+
code,
|
|
2581
|
+
key
|
|
2582
|
+
});
|
|
2553
2583
|
});
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2584
|
+
if (!focusTarget) {
|
|
2585
|
+
const activeResults = await chrome.scripting.executeScript({
|
|
2586
|
+
target: { tabId },
|
|
2587
|
+
world: "MAIN",
|
|
2588
|
+
func: () => {
|
|
2589
|
+
const el = document.activeElement ?? document.body;
|
|
2590
|
+
return {
|
|
2591
|
+
tagName: el.tagName.toLowerCase(),
|
|
2592
|
+
id: el.id || void 0
|
|
2593
|
+
};
|
|
2594
|
+
},
|
|
2595
|
+
args: []
|
|
2596
|
+
});
|
|
2597
|
+
const activeResult = extractScriptResult(activeResults, id);
|
|
2598
|
+
if (!activeResult)
|
|
2599
|
+
return;
|
|
2600
|
+
focusTarget = { tagName: activeResult.tagName, id: activeResult.id };
|
|
2601
|
+
}
|
|
2602
|
+
sendSuccessResult(id, { pressed: true, key, target: focusTarget });
|
|
2558
2603
|
} catch (err2) {
|
|
2559
2604
|
sendErrorResult(id, err2);
|
|
2560
2605
|
}
|
|
@@ -2967,21 +3012,26 @@ var injectAdapterFile = async (tabId, pluginName, adapterHash, adapterFilePath)
|
|
|
2967
3012
|
}
|
|
2968
3013
|
}
|
|
2969
3014
|
};
|
|
2970
|
-
var queryMatchingTabIds = async (urlPatterns) => {
|
|
2971
|
-
const
|
|
3015
|
+
var queryMatchingTabIds = async (urlPatterns, excludePatterns) => {
|
|
3016
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3017
|
+
const ids = [];
|
|
2972
3018
|
for (const pattern of urlPatterns) {
|
|
2973
3019
|
try {
|
|
2974
3020
|
const tabs = await chrome.tabs.query({ url: pattern });
|
|
2975
3021
|
for (const tab of tabs) {
|
|
2976
|
-
if (tab.id !== void 0) {
|
|
2977
|
-
|
|
3022
|
+
if (tab.id !== void 0 && !seen.has(tab.id)) {
|
|
3023
|
+
if (excludePatterns && excludePatterns.length > 0 && tab.url && urlMatchesPatterns(tab.url, excludePatterns)) {
|
|
3024
|
+
continue;
|
|
3025
|
+
}
|
|
3026
|
+
seen.add(tab.id);
|
|
3027
|
+
ids.push(tab.id);
|
|
2978
3028
|
}
|
|
2979
3029
|
}
|
|
2980
3030
|
} catch (err2) {
|
|
2981
3031
|
console.warn(`[opentabs] chrome.tabs.query failed for pattern ${pattern}:`, err2);
|
|
2982
3032
|
}
|
|
2983
3033
|
}
|
|
2984
|
-
return
|
|
3034
|
+
return ids;
|
|
2985
3035
|
};
|
|
2986
3036
|
var prepareForReinjection = async (tabId) => {
|
|
2987
3037
|
await chrome.scripting.executeScript({
|
|
@@ -3014,12 +3064,12 @@ var prepareForReinjection = async (tabId) => {
|
|
|
3014
3064
|
console.warn(`[opentabs] prepareForReinjection failed:`, err2);
|
|
3015
3065
|
});
|
|
3016
3066
|
};
|
|
3017
|
-
var injectPluginIntoMatchingTabs = async (pluginName, urlPatterns, forceReinject = false, adapterHash, adapterFile, skipIfHashMatches) => {
|
|
3067
|
+
var injectPluginIntoMatchingTabs = async (pluginName, urlPatterns, forceReinject = false, adapterHash, adapterFile, skipIfHashMatches, excludePatterns) => {
|
|
3018
3068
|
if (!isSafePluginName(pluginName)) {
|
|
3019
3069
|
console.warn(`[opentabs] Skipping injection for unsafe plugin name: ${pluginName}`);
|
|
3020
3070
|
return [];
|
|
3021
3071
|
}
|
|
3022
|
-
const tabIds = await queryMatchingTabIds(urlPatterns);
|
|
3072
|
+
const tabIds = await queryMatchingTabIds(urlPatterns, excludePatterns);
|
|
3023
3073
|
const results = await Promise.allSettled(tabIds.map(async (tabId) => {
|
|
3024
3074
|
if (!forceReinject && await isAdapterPresent(tabId, pluginName)) {
|
|
3025
3075
|
return tabId;
|
|
@@ -3049,7 +3099,7 @@ var injectPluginsIntoTab = async (tabId, tabUrl) => {
|
|
|
3049
3099
|
const plugins = Object.values(index);
|
|
3050
3100
|
if (plugins.length === 0)
|
|
3051
3101
|
return;
|
|
3052
|
-
const matching = plugins.filter((p) => isSafePluginName(p.name) && urlMatchesPatterns(tabUrl, p.urlPatterns));
|
|
3102
|
+
const matching = plugins.filter((p) => isSafePluginName(p.name) && urlMatchesPatterns(tabUrl, p.urlPatterns, p.excludePatterns));
|
|
3053
3103
|
if (matching.length === 0)
|
|
3054
3104
|
return;
|
|
3055
3105
|
const presenceResults = await Promise.allSettled(matching.map(async (plugin) => ({
|
|
@@ -3067,12 +3117,12 @@ var injectPluginsIntoTab = async (tabId, tabUrl) => {
|
|
|
3067
3117
|
}
|
|
3068
3118
|
}));
|
|
3069
3119
|
};
|
|
3070
|
-
var cleanupAdaptersInMatchingTabs = async (pluginName, urlPatterns) => {
|
|
3120
|
+
var cleanupAdaptersInMatchingTabs = async (pluginName, urlPatterns, excludePatterns) => {
|
|
3071
3121
|
if (!isSafePluginName(pluginName)) {
|
|
3072
3122
|
console.warn(`[opentabs] Skipping cleanup for unsafe plugin name: ${pluginName}`);
|
|
3073
3123
|
return;
|
|
3074
3124
|
}
|
|
3075
|
-
const tabIds = await queryMatchingTabIds(urlPatterns);
|
|
3125
|
+
const tabIds = await queryMatchingTabIds(urlPatterns, excludePatterns);
|
|
3076
3126
|
await Promise.allSettled(tabIds.map(async (tabId) => {
|
|
3077
3127
|
try {
|
|
3078
3128
|
await chrome.scripting.executeScript({
|
|
@@ -3120,7 +3170,7 @@ var reinjectStoredPlugins = async () => {
|
|
|
3120
3170
|
const plugins = Object.values(index);
|
|
3121
3171
|
if (plugins.length === 0)
|
|
3122
3172
|
return;
|
|
3123
|
-
const results = await Promise.allSettled(plugins.map((plugin) => injectPluginIntoMatchingTabs(plugin.name, plugin.urlPatterns, false, plugin.adapterHash, plugin.adapterFile)));
|
|
3173
|
+
const results = await Promise.allSettled(plugins.map((plugin) => injectPluginIntoMatchingTabs(plugin.name, plugin.urlPatterns, false, plugin.adapterHash, plugin.adapterFile, void 0, plugin.excludePatterns)));
|
|
3124
3174
|
for (let i = 0; i < results.length; i++) {
|
|
3125
3175
|
const result = results[i];
|
|
3126
3176
|
if (result && result.status === "rejected") {
|
|
@@ -3305,6 +3355,22 @@ var removePendingPluginAllToolsUpdate = (plugin, toolNames) => {
|
|
|
3305
3355
|
if (toolMap.size === 0)
|
|
3306
3356
|
pendingPluginToolUpdates.delete(plugin);
|
|
3307
3357
|
};
|
|
3358
|
+
var addPendingBrowserToolUpdate = (tool, permission) => {
|
|
3359
|
+
pendingBrowserToolUpdates.set(tool, permission);
|
|
3360
|
+
};
|
|
3361
|
+
var removePendingBrowserToolUpdate = (tool) => {
|
|
3362
|
+
pendingBrowserToolUpdates.delete(tool);
|
|
3363
|
+
};
|
|
3364
|
+
var addPendingAllBrowserToolsUpdate = (toolNames, permission) => {
|
|
3365
|
+
for (const name of toolNames) {
|
|
3366
|
+
pendingBrowserToolUpdates.set(name, permission);
|
|
3367
|
+
}
|
|
3368
|
+
};
|
|
3369
|
+
var removePendingAllBrowserToolsUpdate = (toolNames) => {
|
|
3370
|
+
for (const name of toolNames) {
|
|
3371
|
+
pendingBrowserToolUpdates.delete(name);
|
|
3372
|
+
}
|
|
3373
|
+
};
|
|
3308
3374
|
var cachesInitialized = false;
|
|
3309
3375
|
var persistTimer;
|
|
3310
3376
|
var persistToSession = () => {
|
|
@@ -3401,7 +3467,7 @@ var dispatchWithTabFallback = async (config) => {
|
|
|
3401
3467
|
continue;
|
|
3402
3468
|
try {
|
|
3403
3469
|
const currentTab = await chrome.tabs.get(tab.id);
|
|
3404
|
-
if (!currentTab.url || !urlMatchesPatterns(currentTab.url, plugin.urlPatterns)) {
|
|
3470
|
+
if (!currentTab.url || !urlMatchesPatterns(currentTab.url, plugin.urlPatterns, plugin.excludePatterns)) {
|
|
3405
3471
|
firstError ??= { code: JSONRPC_NO_USABLE_TAB, message: "Tab navigated away from matching URL" };
|
|
3406
3472
|
continue;
|
|
3407
3473
|
}
|
|
@@ -3473,7 +3539,7 @@ var dispatchToTargetedTab = async (config) => {
|
|
|
3473
3539
|
});
|
|
3474
3540
|
return;
|
|
3475
3541
|
}
|
|
3476
|
-
if (!tab.url || !urlMatchesPatterns(tab.url, plugin.urlPatterns)) {
|
|
3542
|
+
if (!tab.url || !urlMatchesPatterns(tab.url, plugin.urlPatterns, plugin.excludePatterns)) {
|
|
3477
3543
|
sendToServer({
|
|
3478
3544
|
jsonrpc: "2.0",
|
|
3479
3545
|
error: {
|
|
@@ -3808,6 +3874,8 @@ var toPluginMeta = (p) => ({
|
|
|
3808
3874
|
version: p.version,
|
|
3809
3875
|
displayName: p.displayName,
|
|
3810
3876
|
urlPatterns: p.urlPatterns,
|
|
3877
|
+
excludePatterns: p.excludePatterns.length > 0 ? p.excludePatterns : void 0,
|
|
3878
|
+
homepage: p.homepage,
|
|
3811
3879
|
permission: p.permission,
|
|
3812
3880
|
sourcePath: p.sourcePath,
|
|
3813
3881
|
adapterHash: p.adapterHash,
|
|
@@ -3833,6 +3901,8 @@ var validatePluginPayload = (raw) => {
|
|
|
3833
3901
|
return null;
|
|
3834
3902
|
}
|
|
3835
3903
|
const urlPatterns = Array.isArray(obj.urlPatterns) ? obj.urlPatterns.filter((p) => typeof p === "string") : [];
|
|
3904
|
+
const excludePatterns = Array.isArray(obj.excludePatterns) ? obj.excludePatterns.filter((p) => typeof p === "string") : [];
|
|
3905
|
+
const homepage = typeof obj.homepage === "string" && obj.homepage.length > 0 ? obj.homepage : void 0;
|
|
3836
3906
|
const tools = Array.isArray(obj.tools) ? obj.tools.filter((t) => typeof t === "object" && t !== null && typeof t.name === "string" && typeof t.description === "string").map((t) => {
|
|
3837
3907
|
if (t.permission !== "off" && t.permission !== "ask" && t.permission !== "auto") {
|
|
3838
3908
|
console.warn(`[opentabs] Tool "${t.name}" in plugin "${obj.name}" has invalid "permission" field \u2014 defaulting to permission='off'. This is a server-side bug.`);
|
|
@@ -3852,6 +3922,8 @@ var validatePluginPayload = (raw) => {
|
|
|
3852
3922
|
version: typeof obj.version === "string" ? obj.version : "0.0.0",
|
|
3853
3923
|
displayName: typeof obj.displayName === "string" ? obj.displayName : obj.name,
|
|
3854
3924
|
urlPatterns,
|
|
3925
|
+
excludePatterns,
|
|
3926
|
+
homepage,
|
|
3855
3927
|
permission: obj.permission === "off" || obj.permission === "ask" || obj.permission === "auto" ? obj.permission : "off",
|
|
3856
3928
|
sourcePath: typeof obj.sourcePath === "string" ? obj.sourcePath : void 0,
|
|
3857
3929
|
adapterHash: typeof obj.adapterHash === "string" ? obj.adapterHash : void 0,
|
|
@@ -3899,7 +3971,7 @@ var handleSyncFull = async (params) => {
|
|
|
3899
3971
|
await Promise.allSettled(removedNames.map((name) => {
|
|
3900
3972
|
const meta = existingMeta[name];
|
|
3901
3973
|
if (meta)
|
|
3902
|
-
return cleanupAdaptersInMatchingTabs(name, meta.urlPatterns);
|
|
3974
|
+
return cleanupAdaptersInMatchingTabs(name, meta.urlPatterns, meta.excludePatterns);
|
|
3903
3975
|
return Promise.resolve();
|
|
3904
3976
|
}));
|
|
3905
3977
|
await removePluginsBatch(removedNames);
|
|
@@ -3908,7 +3980,7 @@ var handleSyncFull = async (params) => {
|
|
|
3908
3980
|
}
|
|
3909
3981
|
const metas = uniquePlugins.map(toPluginMeta);
|
|
3910
3982
|
await storePluginsBatch(metas);
|
|
3911
|
-
const injectionResults = await Promise.allSettled(metas.map((meta) => injectPluginIntoMatchingTabs(meta.name, meta.urlPatterns, true, meta.adapterHash, meta.adapterFile, meta.adapterHash)));
|
|
3983
|
+
const injectionResults = await Promise.allSettled(metas.map((meta) => injectPluginIntoMatchingTabs(meta.name, meta.urlPatterns, true, meta.adapterHash, meta.adapterFile, meta.adapterHash, meta.excludePatterns)));
|
|
3912
3984
|
for (const result of injectionResults) {
|
|
3913
3985
|
if (result.status === "rejected") {
|
|
3914
3986
|
console.warn("[opentabs] Plugin injection failed during sync.full:", result.reason);
|
|
@@ -3930,6 +4002,8 @@ var handleSyncFull = async (params) => {
|
|
|
3930
4002
|
source: raw?.source === "npm" || raw?.source === "local" ? raw.source : "local",
|
|
3931
4003
|
tabState: "closed",
|
|
3932
4004
|
urlPatterns: p.urlPatterns,
|
|
4005
|
+
...p.excludePatterns.length > 0 ? { excludePatterns: p.excludePatterns } : {},
|
|
4006
|
+
...p.homepage ? { homepage: p.homepage } : {},
|
|
3933
4007
|
tools: p.tools,
|
|
3934
4008
|
reviewed: raw?.reviewed === true,
|
|
3935
4009
|
iconSvg: p.iconSvg,
|
|
@@ -3973,7 +4047,7 @@ var handlePluginUpdate = async (params) => {
|
|
|
3973
4047
|
return;
|
|
3974
4048
|
const meta = toPluginMeta(validated);
|
|
3975
4049
|
await storePluginsBatch([meta]);
|
|
3976
|
-
await injectPluginIntoMatchingTabs(meta.name, meta.urlPatterns, true, meta.adapterHash, meta.adapterFile);
|
|
4050
|
+
await injectPluginIntoMatchingTabs(meta.name, meta.urlPatterns, true, meta.adapterHash, meta.adapterFile, void 0, meta.excludePatterns);
|
|
3977
4051
|
const newState = await computePluginTabState(meta);
|
|
3978
4052
|
await updateLastKnownState(meta.name, newState);
|
|
3979
4053
|
sendTabStateNotification(meta.name, newState);
|
|
@@ -3986,6 +4060,8 @@ var handlePluginUpdate = async (params) => {
|
|
|
3986
4060
|
source: params.source === "npm" || params.source === "local" ? params.source : "local",
|
|
3987
4061
|
tabState: newState.state,
|
|
3988
4062
|
urlPatterns: validated.urlPatterns,
|
|
4063
|
+
...validated.excludePatterns.length > 0 ? { excludePatterns: validated.excludePatterns } : {},
|
|
4064
|
+
...validated.homepage ? { homepage: validated.homepage } : {},
|
|
3989
4065
|
tools: validated.tools,
|
|
3990
4066
|
reviewed: params.reviewed === true,
|
|
3991
4067
|
iconSvg: validated.iconSvg,
|
|
@@ -4029,7 +4105,7 @@ var handlePluginUninstall = async (params, id) => {
|
|
|
4029
4105
|
const pluginMeta = meta[pluginName];
|
|
4030
4106
|
if (pluginMeta) {
|
|
4031
4107
|
try {
|
|
4032
|
-
await cleanupAdaptersInMatchingTabs(pluginName, pluginMeta.urlPatterns);
|
|
4108
|
+
await cleanupAdaptersInMatchingTabs(pluginName, pluginMeta.urlPatterns, pluginMeta.excludePatterns);
|
|
4033
4109
|
} catch (err2) {
|
|
4034
4110
|
console.warn(`[opentabs] Failed to clean up adapters for ${pluginName}:`, err2);
|
|
4035
4111
|
}
|
|
@@ -4361,6 +4437,24 @@ var handleBgSetToolPermission = (message, sendResponse) => {
|
|
|
4361
4437
|
const plugin = message.plugin;
|
|
4362
4438
|
const tool = message.tool;
|
|
4363
4439
|
const permission = message.permission;
|
|
4440
|
+
if (plugin === "browser") {
|
|
4441
|
+
const cache3 = getServerStateCache();
|
|
4442
|
+
const originalPermission2 = cache3.browserTools.find((t) => t.name === tool)?.permission ?? "auto";
|
|
4443
|
+
const updatedBrowserTools = cache3.browserTools.map((t) => t.name === tool ? { ...t, permission } : t);
|
|
4444
|
+
addPendingBrowserToolUpdate(tool, permission);
|
|
4445
|
+
updateServerStateCache({ browserTools: updatedBrowserTools });
|
|
4446
|
+
sendServerRequest("config.setToolPermission", { plugin, tool, permission }).then((result) => {
|
|
4447
|
+
removePendingBrowserToolUpdate(tool);
|
|
4448
|
+
sendResponse(result);
|
|
4449
|
+
}).catch((err2) => {
|
|
4450
|
+
removePendingBrowserToolUpdate(tool);
|
|
4451
|
+
const currentCache = getServerStateCache();
|
|
4452
|
+
const revertedBrowserTools = currentCache.browserTools.map((t) => t.name === tool ? { ...t, permission: originalPermission2 } : t);
|
|
4453
|
+
updateServerStateCache({ browserTools: revertedBrowserTools });
|
|
4454
|
+
sendResponse({ error: err2 instanceof Error ? err2.message : String(err2) });
|
|
4455
|
+
});
|
|
4456
|
+
return;
|
|
4457
|
+
}
|
|
4364
4458
|
const cache2 = getServerStateCache();
|
|
4365
4459
|
const pluginEntry = cache2.plugins.find((p) => p.name === plugin);
|
|
4366
4460
|
const originalPermission = pluginEntry?.tools.find((t) => t.name === tool)?.permission ?? "auto";
|
|
@@ -4395,6 +4489,31 @@ var handleBgSetToolPermission = (message, sendResponse) => {
|
|
|
4395
4489
|
var handleBgSetAllToolsPermission = (message, sendResponse) => {
|
|
4396
4490
|
const plugin = message.plugin;
|
|
4397
4491
|
const permission = message.permission;
|
|
4492
|
+
if (plugin === "browser") {
|
|
4493
|
+
const cache3 = getServerStateCache();
|
|
4494
|
+
const toolNames2 = cache3.browserTools.map((t) => t.name);
|
|
4495
|
+
const originalToolStates2 = /* @__PURE__ */ new Map();
|
|
4496
|
+
for (const t of cache3.browserTools) {
|
|
4497
|
+
originalToolStates2.set(t.name, t.permission);
|
|
4498
|
+
}
|
|
4499
|
+
const updatedBrowserTools = cache3.browserTools.map((t) => ({ ...t, permission }));
|
|
4500
|
+
addPendingAllBrowserToolsUpdate(toolNames2, permission);
|
|
4501
|
+
updateServerStateCache({ browserTools: updatedBrowserTools });
|
|
4502
|
+
sendServerRequest("config.setAllToolsPermission", { plugin, permission }).then((result) => {
|
|
4503
|
+
removePendingAllBrowserToolsUpdate(toolNames2);
|
|
4504
|
+
sendResponse(result);
|
|
4505
|
+
}).catch((err2) => {
|
|
4506
|
+
removePendingAllBrowserToolsUpdate(toolNames2);
|
|
4507
|
+
const currentCache = getServerStateCache();
|
|
4508
|
+
const revertedBrowserTools = currentCache.browserTools.map((t) => ({
|
|
4509
|
+
...t,
|
|
4510
|
+
permission: originalToolStates2.get(t.name) ?? t.permission
|
|
4511
|
+
}));
|
|
4512
|
+
updateServerStateCache({ browserTools: revertedBrowserTools });
|
|
4513
|
+
sendResponse({ error: err2 instanceof Error ? err2.message : String(err2) });
|
|
4514
|
+
});
|
|
4515
|
+
return;
|
|
4516
|
+
}
|
|
4398
4517
|
const cache2 = getServerStateCache();
|
|
4399
4518
|
const pluginEntry = cache2.plugins.find((p) => p.name === plugin);
|
|
4400
4519
|
const toolNames = pluginEntry ? pluginEntry.tools.map((t) => t.name) : [];
|
|
@@ -4460,6 +4579,18 @@ var handleBgSetPluginPermission = (message, sendResponse) => {
|
|
|
4460
4579
|
sendResponse({ error: err2 instanceof Error ? err2.message : String(err2) });
|
|
4461
4580
|
});
|
|
4462
4581
|
};
|
|
4582
|
+
var handleBgSetSkipPermissions = (message, sendResponse) => {
|
|
4583
|
+
const skipPermissions = message.skipPermissions;
|
|
4584
|
+
const cache2 = getServerStateCache();
|
|
4585
|
+
const originalSkipPermissions = cache2.skipPermissions ?? false;
|
|
4586
|
+
updateServerStateCache({ skipPermissions });
|
|
4587
|
+
sendServerRequest("config.setSkipPermissions", { skipPermissions }).then((result) => {
|
|
4588
|
+
sendResponse(result);
|
|
4589
|
+
}).catch((err2) => {
|
|
4590
|
+
updateServerStateCache({ skipPermissions: originalSkipPermissions });
|
|
4591
|
+
sendResponse({ error: err2 instanceof Error ? err2.message : String(err2) });
|
|
4592
|
+
});
|
|
4593
|
+
};
|
|
4463
4594
|
var handleBgSearchPlugins = (message, sendResponse) => {
|
|
4464
4595
|
const query = message.query;
|
|
4465
4596
|
sendServerRequest("plugin.search", { query }).then((result) => {
|
|
@@ -4484,6 +4615,14 @@ var handleBgRemovePlugin = (message, sendResponse) => {
|
|
|
4484
4615
|
sendResponse({ error: err2 instanceof Error ? err2.message : String(err2) });
|
|
4485
4616
|
});
|
|
4486
4617
|
};
|
|
4618
|
+
var handleBgRemoveFailedPlugin = (message, sendResponse) => {
|
|
4619
|
+
const specifier = message.specifier;
|
|
4620
|
+
sendServerRequest("plugin.removeBySpecifier", { specifier }).then((result) => {
|
|
4621
|
+
sendResponse(result);
|
|
4622
|
+
}).catch((err2) => {
|
|
4623
|
+
sendResponse({ error: err2 instanceof Error ? err2.message : String(err2) });
|
|
4624
|
+
});
|
|
4625
|
+
};
|
|
4487
4626
|
var handleBgUpdatePlugin = (message, sendResponse) => {
|
|
4488
4627
|
const name = message.name;
|
|
4489
4628
|
sendServerRequest("plugin.updateFromRegistry", { name }).then((result) => {
|
|
@@ -4505,9 +4644,11 @@ var backgroundHandlers = /* @__PURE__ */ new Map([
|
|
|
4505
4644
|
["bg:setToolPermission", handleBgSetToolPermission],
|
|
4506
4645
|
["bg:setAllToolsPermission", handleBgSetAllToolsPermission],
|
|
4507
4646
|
["bg:setPluginPermission", handleBgSetPluginPermission],
|
|
4647
|
+
["bg:setSkipPermissions", handleBgSetSkipPermissions],
|
|
4508
4648
|
["bg:searchPlugins", handleBgSearchPlugins],
|
|
4509
4649
|
["bg:installPlugin", handleBgInstallPlugin],
|
|
4510
4650
|
["bg:removePlugin", handleBgRemovePlugin],
|
|
4651
|
+
["bg:removeFailedPlugin", handleBgRemoveFailedPlugin],
|
|
4511
4652
|
["bg:updatePlugin", handleBgUpdatePlugin],
|
|
4512
4653
|
["plugin:logs", handlePluginLogs],
|
|
4513
4654
|
["tool:progress", handleToolProgress],
|
|
@@ -4522,9 +4663,11 @@ var EXTENSION_ONLY_TYPES = /* @__PURE__ */ new Set([
|
|
|
4522
4663
|
"bg:setToolPermission",
|
|
4523
4664
|
"bg:setAllToolsPermission",
|
|
4524
4665
|
"bg:setPluginPermission",
|
|
4666
|
+
"bg:setSkipPermissions",
|
|
4525
4667
|
"bg:searchPlugins",
|
|
4526
4668
|
"bg:installPlugin",
|
|
4527
4669
|
"bg:removePlugin",
|
|
4670
|
+
"bg:removeFailedPlugin",
|
|
4528
4671
|
"bg:updatePlugin",
|
|
4529
4672
|
"offscreen:getLogs",
|
|
4530
4673
|
"sp:confirmationResponse",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Clicks a DOM element matched by a CSS selector in a tab's page context.
|
|
3
|
+
* Resolves the element's bounding rect via scripting, then dispatches trusted
|
|
4
|
+
* (isTrusted: true) mouse events at the element center via CDP Input.dispatchMouseEvent.
|
|
3
5
|
* @param params - Expects `{ tabId: number, selector: string }`.
|
|
4
6
|
* @returns `{ clicked, tagName, text }` describing the clicked element.
|
|
5
7
|
*/
|