Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Agent indicator: classic glow and target ring hold still under reduced motion

Claude807eb07b3405
diff --git a/src/chrome/src/content/agent-visual-indicator.js b/src/chrome/src/content/agent-visual-indicator.js
index c77e786f8..413d43c22 100644
--- a/src/chrome/src/content/agent-visual-indicator.js
+++ b/src/chrome/src/content/agent-visual-indicator.js
@@ -120,6 +120,19 @@
0 0 32px rgba(108, 99, 255, 0.38);
}
}
+
+ /* The canvas effects and the cursor check this in script; the glow
+ and the target ring are CSS, so they hold still here. */
+ @media (prefers-reduced-motion: reduce) {
+ #webbrain-agent-glow-border { animation: none !important; }
+ #webbrain-agent-target-outline {
+ animation: none !important;
+ transition: opacity 0.35s ease !important;
+ box-shadow:
+ 0 0 0 3px rgba(108, 99, 255, 0.18),
+ 0 0 24px rgba(108, 99, 255, 0.28) !important;
+ }
+ }
`;
(document.head || document.documentElement).appendChild(style);
}
diff --git a/src/firefox/src/content/agent-visual-indicator.js b/src/firefox/src/content/agent-visual-indicator.js
index 93e3280a4..a4bd6a65a 100644
--- a/src/firefox/src/content/agent-visual-indicator.js
+++ b/src/firefox/src/content/agent-visual-indicator.js
@@ -120,6 +120,19 @@
0 0 32px rgba(108, 99, 255, 0.38);
}
}
+
+ /* The canvas effects and the cursor check this in script; the glow
+ and the target ring are CSS, so they hold still here. */
+ @media (prefers-reduced-motion: reduce) {
+ #webbrain-agent-glow-border { animation: none !important; }
+ #webbrain-agent-target-outline {
+ animation: none !important;
+ transition: opacity 0.35s ease !important;
+ box-shadow:
+ 0 0 0 3px rgba(108, 99, 255, 0.18),
+ 0 0 24px rgba(108, 99, 255, 0.28) !important;
+ }
+ }
`;
(document.head || document.documentElement).appendChild(style);
}
diff --git a/test/page-monitor-ui.mjs b/test/page-monitor-ui.mjs
index b235f8e36..185d94634 100644
--- a/test/page-monitor-ui.mjs
+++ b/test/page-monitor-ui.mjs
@@ -2305,6 +2305,17 @@ for (const [build, engine] of [['chrome', chromium], ['firefox', firefox]]) {
await page.evaluate(() => messageListeners.forEach(listener => listener({ type: 'WB_SHOW_AFTER_TOOL_USE' }, {}, () => {})));
await page.locator('#human').click();
assert.ok((await page.evaluate(() => feedback)).some(event => event.kind === 'click' && event.source === 'user'));
+ // Reduced motion: the canvas keeps one still frame, and the glow and the ring stop pulsing.
+ await page.emulateMedia({ reducedMotion: 'reduce' });
+ await page.waitForTimeout(100);
+ const frame = () => page.evaluate(() => document.getElementById('webbrain-agent-effect').toDataURL());
+ const still = await frame();
+ await page.waitForTimeout(400);
+ assert.equal(await frame(), still, 'the circuit holds still under reduced motion');
+ await page.evaluate(() => storageListeners.forEach(fn => fn({ agentIndicatorStyle: { newValue: 'classic' } }, 'local')));
+ await page.evaluate(() => window.__webbrainAgentIndicator.showTarget(document.getElementById('select'), 'click_coordinates'));
+ assert.deepEqual(await page.evaluate(() => ['webbrain-agent-glow-border', 'webbrain-agent-target-outline']
+ .map(id => getComputedStyle(document.getElementById(id)).animationName)), ['none', 'none']);
} finally { await browser.close(); }
});