aboutsummaryrefslogtreecommitdiff
path: root/extensions/chrome-profile-bridge/browser-extension
diff options
context:
space:
mode:
authorTianren Dong <tianrendong.dtr@gmail.com>2026-05-13 01:55:49 -0400
committerTianren Dong <tianrendong.dtr@gmail.com>2026-05-13 01:55:49 -0400
commitc53af2f813347f8e36f3ff44ab97a3cdbbb15387 (patch)
tree10a963b4d6e2ef2f2a328372bab04c7ccce647d1 /extensions/chrome-profile-bridge/browser-extension
parentf0d86b4f73af9e8f3d4026ed74f35d4875046994 (diff)
pi-chrome 0.11.3: plain-English copy in /chrome-trusted + /chrome-doctor
User-facing strings rewritten in layman's terms — no more 'CDP', 'isTrusted', 'user-activation gates', 'synthetic events', 'debugger API'. /chrome-trusted picker now explains each mode by what users actually experience: yellow banner, which sites work, when to use it. /chrome-doctor reports 'Click mode' instead of 'Trusted-input mode'. Tool descriptions (read by the agent) keep precise terminology.
Diffstat (limited to 'extensions/chrome-profile-bridge/browser-extension')
-rw-r--r--extensions/chrome-profile-bridge/browser-extension/manifest.json2
-rw-r--r--extensions/chrome-profile-bridge/browser-extension/service_worker.js12
2 files changed, 7 insertions, 7 deletions
diff --git a/extensions/chrome-profile-bridge/browser-extension/manifest.json b/extensions/chrome-profile-bridge/browser-extension/manifest.json
index c230cc9..4b0f971 100644
--- a/extensions/chrome-profile-bridge/browser-extension/manifest.json
+++ b/extensions/chrome-profile-bridge/browser-extension/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Pi Chrome Connector",
- "version": "0.11.2",
+ "version": "0.11.3",
"description": "Lets Pi control tabs in Chrome via a local connector at 127.0.0.1.",
"permissions": ["tabs", "scripting", "storage", "activeTab", "alarms", "webNavigation", "debugger"],
"host_permissions": ["<all_urls>", "http://127.0.0.1:17318/*"],
diff --git a/extensions/chrome-profile-bridge/browser-extension/service_worker.js b/extensions/chrome-profile-bridge/browser-extension/service_worker.js
index 0a836e8..04e8a4e 100644
--- a/extensions/chrome-profile-bridge/browser-extension/service_worker.js
+++ b/extensions/chrome-profile-bridge/browser-extension/service_worker.js
@@ -169,7 +169,7 @@ async function cdpMoveTo(tabId, x, y) {
const entry = attachedTabs.get(tabId);
const startX = entry?.pointer?.x ?? Math.max(20, Math.min(400, x - 200));
const startY = entry?.pointer?.y ?? Math.max(20, Math.min(400, y - 200));
- const n = Math.max(10, Math.min(36, Math.round(Math.hypot(x - startX, y - startY) / 20)));
+ const n = Math.max(18, Math.min(42, Math.round(Math.hypot(x - startX, y - startY) / 18)));
for (let i = 1; i <= n; i++) {
const t = i / n;
const ease = t * t * (3 - 2 * t);
@@ -368,13 +368,13 @@ async function trustedScroll(params) {
const y = resolved.rect ? resolved.rect.top + Math.min(resolved.rect.height, 600) / 2 : resolved.y;
const totalY = params.deltaY || 0, totalX = params.deltaX || 0;
// Per-event delta cap so IntersectionObserver / scroll-driven animations get gradient samples.
- // A real wheel notch is ~50-120px; we aim for the lower end so visibility transitions are visible.
- const MAX_STEP = 60;
+ // A trackpad inertia tick often delivers ~10-30px per frame; using ~25px keeps small-target
+ // visibility transitions detectable while not making large scrolls take forever.
+ const MAX_STEP = 25;
const peak = Math.max(Math.abs(totalY), Math.abs(totalX));
- // We weight events with mild front-loading. The peak weight = 1.5 / n (vs uniform 1/n), so the
- // first event is ~1.5× average. Choose n so even the peak event stays under MAX_STEP.
+ // Front-loaded weights peak at ~1.5× average, so choose n so peak event stays under MAX_STEP.
const minN = Math.ceil(peak * 1.5 / MAX_STEP);
- const n = Math.max(6, Math.min(80, params.steps || Math.max(minN, 12)));
+ const n = Math.max(6, Math.min(200, params.steps || Math.max(minN, 12)));
// Front-loaded but smooth weights: w[i] = 1 + 0.5 * (1 - i/(n-1)) so the first event has
// weight 1.5, the last has 1.0, average ~1.25; redistribution stays predictable.
const w = [];