Conheça o WebBrain: um agente de navegador com IA de código aberto e local-first que lê páginas e automatiza tarefas no Chrome e no Firefox

Conheça o WebBrain: um agente de navegador com IA de código aberto e local-first que lê páginas e automatiza tarefas no Chrome e no Firefox

O WebBrain é um agente de navegador com IA gratuito e licenciado sob a MIT para Chrome e Firefox. Ele lê páginas, extrai dados e automatiza tarefas de múltiplas etapas por meio dos modos Ask e Act. Execute-o em modelos locais como llama.cpp ou Ollama para ter privacidade, ou conecte qualquer API na nuvem. O post Conheça o WebBrain: um agente de navegador com IA de código aberto e local-first que lê páginas e automatiza tarefas no Chrome e no Firefox apareceu primeiro no MarkTechPost.

MarkTechPost ·Asif Razzaq ·

WebBrain is a free, open-source browser agent for Chrome and Firefox. It reads pages, extracts data, and automates multi-step tasks. Unlike most browser AI plugins, it can also run entirely on a local model.

It is built by Emre Sokullu and licensed under MIT. The full source lives on GitHub.

Run the agent against a local model, and no page data leaves your machine. Connect a cloud API when you want more capability.

What is WebBrain?

WebBrain lives in your browser’s side panel. In Chrome it uses Manifest V3 and the sidePanel API. In Firefox it uses Manifest V2 and sidebar_action. Each tab keeps its own conversation history.

The extension operates inside your existing authenticated session. It sees your logged-in accounts exactly as you do. It stores no data externally and adds no telemetry or accounts.

The plugin ships in English, Español, Français, Türkçe, and 中文. It auto-detects your browser language on first launch.

Ask Mode, Act Mode, and How Actions Actually Fire

WebBrain has two modes: Ask mode is read-only and cannot change the page. Act mode can click, type, scroll, navigate, and run workflows.

Ask mode reads pages through ordinary content scripts. Act mode is different. It drives the page through the Chrome DevTools Protocol via the chrome.debugger API. That produces trusted input events that modern sites actually honor. It also reaches cross-origin iframes and shadow DOM that content scripts cannot see.

That power is scoped deliberately. WebBrain attaches the debugger only when an action needs it, per tab. Chrome surfaces its standard ‘WebBrain started debugging this browser’ banner while attached. Firefox has no CDP equivalent, so its Act mode is meaningfully weaker.

Temperatures are fixed for predictability. Act mode uses temperature 0.15. Ask mode uses 0.3. Dedicated vision screenshot descriptions use 0.

The Security Model

Browser agents run on an adversarial surface. Web pages can hide prompt injections that hijack an agent’s behavior. WebBrain’s design addresses this directly.

The agent starts in read-only Ask mode. It asks before consequential actions. You can disable those prompts in the Permissions settings. They are on by default.

There is also a UI-first rule for mutations. For anything that creates, sends, submits, or buys, WebBrain uses the visible UI. It refuses to call REST or GraphQL endpoints directly for mutations. A per-conversation /allow-api override exists when the UI genuinely fails.

Reading is treated separately. Fetching a README or comparing prices uses background HTTP through the fetch_url and research_url tools. Reading changes nothing remotely, so the strict rules do not apply.

Use Cases, With Concrete Examples

• Data extraction is the obvious one: Open a catalog and ask: ‘Extract all product names and prices from this page.’ The agent reads the structure and returns rows. It also works with PDFs.

• Research summaries are another: Ask ‘Summarize this article,’ then follow up with a specific question. WebBrain detects paywalls honestly and does not try to bypass them. It also dismisses common cookie-consent banners before reading.

• Form filling suits repetitive signups: An optional Profile auto-fill stores a short bio in local plaintext. That text is sent to your configured LLM to complete low-stakes forms. Keep important passwords out of it.

• Automation spans multiple steps: Try ‘Navigate to github.com and find trending repositories.’ In Act mode, the agent chains navigation, reads, and clicks.

Keeping Token Costs Down

Cloud tokens add up on long sessions. WebBrain bounds the cost in three ways.

• Screenshots are resized and iteratively JPEG-compressed before they leave your machine. That keeps image tokens small.

• Conversation history and tool outputs are trimmed oldest-first as the context window fills.

• You can also pair a cheap text model for planning with a separate vision model for screenshots.

How It Compares

WebBrain sits between browser AI plugins and full agent frameworks. Here is the plugin comparison, drawn from the project’s own documentation.

FeatureWebBrainClaude in ChromeOpen sourceMIT LicenseProprietaryPriceFree foreverRequires Claude Pro ($20/mo)Local LLM supportllama.cpp, OllamaNo — Claude onlyMulti-providerAll OpenAI-compatible endpointsClaude onlyChromeYes (MV3)YesFirefoxYes (MV2)NoSide panel UIYesYesAsk / Act modesYesSimilarFully offlineYes (with local LLM)No — cloud requiredSelf-hostableYesNo

Frameworks like OpenClaw or Browser-Use are a different category. Those are developer SDKs for headless pipelines. WebBrain is an end-user extension you drive from a chat panel. You can use both.

Running It: Providers and Setup

WebBrain supports local and cloud models through one interface. Local options include llama.cpp, Ollama, LM Studio, Jan, vLLM, and SGLang. Cloud options include OpenAI, Anthropic Claude, Gemini, Mistral, DeepSeek, and xAI Grok. It also supports Groq, MiniMax, Alibaba Cloud (Qwen), Nvidia NIM, and OpenRouter.

A built-in managed option, WebBrain Cloud, needs no local setup. It costs $5 per month per device profile under a fair-use policy. For local use, llama.cpp needs no API key.

Starting a local server takes one command:

Copy CodeCopiedUse a different Browser

# llama.cpp — load at least a 16k-token context window

llama-server -m your-model.gguf -c 16384 --port 8080

# Ollama (OpenAI-compatible) — set the extension-origin env var

OLLAMA_ORIGINS="*" ollama serve

# then set the base URL to http://localhost:11434/v1 in settings

Point WebBrain at the endpoint in settings. For a cross-machine vLLM server, enable CORS with –allowed-origins ‘[“*”]’.

The recommended model is Qwen 3.6 35B (Qwen3.6-35B-A3B). It beat Gemma 4 on the project’s screenshot benchmark. An RTX 5090 is ideal; an RTX 4090 works with INT4 AutoRound quantization.

Each provider is a class that extends BaseLLMProvider. It normalizes to one response shape:

Copy CodeCopiedUse a different Browser

{ content: string, toolCalls: Array|null, usage: Object|null }

Key Takeaways

• WebBrain is a free, MIT-licensed AI browser agent for Chrome and Firefox, built by Emre Sokullu.

• It runs on local models (llama.cpp, Ollama; Qwen 3.6 35B recommended) or any cloud API — no page data leaves your machine when local.

• Ask mode reads pages read-only; Act mode clicks and types via the Chrome DevTools Protocol for trusted input events.

• Security-first by design: starts read-only, approves consequential actions, and uses the UI instead of direct API calls for mutations.

• Free forever self-hosted, or $5/month per device profile for the managed WebBrain Cloud under fair use.

Interactive Explainer with Demo

WebBrain — Interactive Demo

Pick a task, choose Ask or Act, and watch the agent work.

Simulated · no real LLM calls

WebBrain

Ask

Choose a task above, then press Run. Read-only Ask mode is the default.

Actions here are illustrative and safe. The real extension asks before consequential actions.

Built by Marktechpost

(function(){

var SCEN = {

products: {

label:"Extract products", req:"ask",

url:"https://example.com/products",

prompt:"Extract all product names and prices from this page",

page:'Product Catalog'+

'

Widget Pro$29.99
'+

'

Super Gadget$49.99
'+

'

MegaTool X$19.99
'+

'

Nano Clip$8.50
'+

'

HyperDock$74.00
'+

'

PixelCase$14.25
'+

'

…and 18 more

',

{t:'Reading page', c:'get_accessibility_tree'},

{t:'Extracting structured rows', c:'extract_data'}

result:function(){

return '

Found 24 products

'+

'

'+

'

'+

'

'+

'

'+

'

'+

'

'+

'

Widget Pro$29.99
Super Gadget$49.99
MegaTool X$19.99
Nano Clip$8.50
HyperDock$74.00
PixelCase$14.25

…and 18 more. Export as CSV or JSON.

';

label:"Summarize article", req:"ask",

url:"https://magazine.dev/local-ai-2026",

prompt:"Summarize this article",

page:'The Future of Local AI

By Jane Smith · 8 min read

'+

'

Local LLMs now match cloud quality on many tasks. Better quantization, faster consumer GPUs, '+

'and a privacy-first shift are the drivers. The author expects most consumer AI to run on-device by 2026.

',

{t:'Reading page text', c:'read_page'}

result:function(){

return '

Summary

    '+

    '

  • Local LLMs now rival cloud quality on many tasks.
  • '+

    '

  • Drivers: better quantization, faster GPUs, privacy demand.
  • '+

    '

  • Author predicts 70%+ of consumer AI runs on-device by 2026.
  • '+

    '

Follow-up: '+

'What does the author predict for 2026?

';

steps:[{t:'Recalling article context', c:'scratchpad_write'}],

result:'

Answer

By 2026, the author expects 70%+ of consumer AI workloads to run on-device.

'

label:"Download video", req:"act",

url:"https://socialvid.app/@nomad/clip-8472",

prompt:"Download this video",

page:'

▶ Sunset timelapse over Bodrum
'+

'@nomad · 0:24

Video post

',

{t:'Listing interactive elements', c:'get_interactive_elements'},

{t:'Capturing visible tab', c:'screenshot', token:true},

{t:'Locating video stream', c:'download_resource_from_page'}

approve:"Download the MP4 to your machine?",

result:function(){

return '

Saved

Downloads/nomad-bodrum.mp4

'+

'

1080p · 24s · 4.2 MB

';

label:"Fill signup form", req:"act",

url:"https://acmestudio.io/signup",

prompt:"Sign me up using my profile",

page:'Create your Acme Studio account'+

'

'+

'

'+

'

'+

'

Uses optional Profile auto-fill (stored locally, plaintext).

',

{t:'Reading form fields', c:'get_accessibility_tree'},

{t:'Filling email', c:'set_field', fill:{id:'f-email',v:'dev@example.com'}},

{t:'Filling company', c:'set_field', fill:{id:'f-company',v:'Acme Labs'}},

{t:'Filling throwaway password', c:'set_field', fill:{id:'f-pass',v:'••••••••'}},

{t:'Checking values before submit', c:'verify_form'}

approve:"Submit the signup form and create the account?",

result:function(){

return '

Account created

Confirmation screen shown by the site.

'+

'

Profile text is sent to your LLM each turn. Keep important passwords out of it.

';

var order = ['products','summary','video','signup'];

var state = { mode:'ask', scen:'products', running:false, aborted:false };

var timers = [];

var $ = function(id){ return document.getElementById(id); };

function clearTimers(){ timers.forEach(clearTimeout); timers = []; }

function renderChips(){

var box = $('wb-chips'); box.innerHTML='';

order.forEach(function(k){

var s = SCEN[k];

var b = document.createElement('button');

b.className = 'wb-chip' + (k===state.scen?' on':'');

b.innerHTML = s.label + ' · '+(s.req==='act'?'Act':'Ask')+'';

b.onclick = function(){ selectScen(k); };

box.appendChild(b);

function renderMode(){

var seg = $('wb-modeseg').querySelectorAll('button');

seg.forEach(function(b){ b.classList.toggle('on', b.dataset.mode===state.mode); });

var pill = $('wb-modepill');

pill.textContent = state.mode==='act'?'Act':'Ask';

pill.className = 'wb-mode-pill '+(state.mode==='act'?'act':'ask');

function selectScen(k){

if(state.running) return;

state.scen = k;

var s = SCEN[k];

$('wb-url').textContent = s.url;

$('wb-page').innerHTML = s.page;

$('wb-input').value = s.prompt;

if(s.req==='act' && state.mode!=='act'){ state.mode='act'; }

renderChips(); renderMode(); resetLog();

function resetLog(){

clearTimers(); state.running=false; state.aborted=false;

$('wb-run').style.display=''; $('wb-run').disabled=false;

var stop=$('wb-stopbtn'); if(stop) stop.remove();

$('wb-log').innerHTML = '

Press Run to start. Ask mode is read-only; Act mode can act.
';

var s=SCEN[state.scen];

if(s.req==='signup'||state.scen==='signup'){ /* fields already blank in page html */ }

function addStep(html){

var d=document.createElement('div'); d.className='wb-step'; d.innerHTML=html;

$('wb-log').appendChild(d); postHeight(); return d;

function showStop(){

var stop=document.createElement('button');

stop.id='wb-stopbtn'; stop.className='wb-stop'; stop.textContent='Stop';

stop.onclick=function(){ state.aborted=true; clearTimers(); finishAbort(); };

$('wb-run').style.display='none';

$('wb-run').parentNode.appendChild(stop);

function hideStop(){ var s=$('wb-stopbtn'); if(s) s.remove(); $('wb-run').style.display=''; $('wb-run').disabled=false; }

function finishAbort(){

state.running=false; hideStop();

addStep('× Stopped by user.');

function run(){

if(state.running) return;

var s = SCEN[state.scen];

if(s.req==='act' && state.mode!=='act'){

$('wb-log').innerHTML='';

addStep(' '+

'Ask mode is read-only. Switch to Act mode to run this task.');

state.running=true; state.aborted=false;

$('wb-log').innerHTML=''; $('wb-run').disabled=true; showStop();

var delay=350;

s.steps.forEach(function(st){

timers.push(setTimeout(function(){

if(state.aborted) return;

var el=addStep(' '+st.t+' · '+st.c+'');

timers.push(setTimeout(function(){

if(state.aborted) return;

el.innerHTML=' '+st.t+' · '+st.c+'';

if(st.token) addStep('

Token-conscious: screenshot 2000×1200 '+

'resized & JPEG-compressed → ~380 image tokens (illustrative).

');

if(st.fill){ var f=document.getElementById(st.fill.id); if(f){ f.innerHTML=st.fill.v; f.classList.add('fill'); } }

postHeight();

}, delay));

delay += 780;

timers.push(setTimeout(function(){

if(state.aborted) return;

if(s.approve){ askApproval(s); } else { finish(s); }

}, delay+150));

function askApproval(s){

var box=document.createElement('div'); box.className='wb-approve';

box.innerHTML='

⚠ Consequential action — '+s.approve+'

'+

'

';

$('wb-log').appendChild(box); postHeight();

box.querySelector('.wb-yes').onclick=function(){ box.remove(); finish(s); };

box.querySelector('.wb-no').onclick=function(){

box.remove(); state.running=false; hideStop();

addStep('× Action cancelled. Nothing was changed.');

function finish(s){

state.running=false; hideStop();

var r=document.createElement('div'); r.className='wb-result'; r.innerHTML=s.result();

$('wb-log').appendChild(r);

addStep(' Task complete · done');

postHeight();

if(s.follow){

var link=document.getElementById('wb-follow');

if(link) link.onclick=function(e){ e.preventDefault(); runFollow(s); };

function runFollow(s){

if(state.running) return; state.running=true; $('wb-run').disabled=true; showStop();

s.follow.steps.forEach(function(st){

timers.push(setTimeout(function(){

if(state.aborted) return;

var el=addStep(' '+st.t+' · '+st.c+'');

timers.push(setTimeout(function(){

if(state.aborted) return;

el.innerHTML=' '+st.t+' · '+st.c+'';

},d)); d+=650;

timers.push(setTimeout(function(){

if(state.aborted) return;

state.running=false; hideStop();

var r=document.createElement('div'); r.className='wb-result'; r.innerHTML=s.follow.result;

$('wb-log').appendChild(r); postHeight();

}, d+150));

// mode buttons

$('wb-modeseg').querySelectorAll('button').forEach(function(b){

b.onclick=function(){ if(state.running) return; state.mode=b.dataset.mode; renderMode(); };

$('wb-run').onclick=run;

$('wb-reset').onclick=function(){ state.mode='ask'; selectScen('products'); };

$('wb-input').addEventListener('keydown',function(e){ if(e.key==='Enter') run(); });

// auto-resize: component's own offsetHeight + 40 (never scrollHeight)

function postHeight(){

var el=document.getElementById('wb-root');

var h=(el?el.offsetHeight:document.body.offsetHeight)+40;

if(window.parent && window.parent!==window){ window.parent.postMessage({wbHeight:h},'*'); }

}catch(e){}

window.postHeight=postHeight;

window.addEventListener('load',function(){ postHeight(); setTimeout(postHeight,300); });

if(window.ResizeObserver){

try{ new ResizeObserver(postHeight).observe(document.getElementById('wb-root')); }catch(e){}

renderChips(); renderMode(); selectScen('products');

(function(){

window.addEventListener("message", function(e){

if(e && e.data && typeof e.data.wbHeight === "number"){

var f = document.getElementById("webbrain-frame");

if(f){ f.style.height = e.data.wbHeight + "px"; }

WebBrain for Developers — Interactive Demo

Read code, extract API specs, research sources, and act — from the side panel.

Simulated · no real LLM calls

WebBrain

Ask

Choose a task above, then press Run. Read-only Ask mode is the default.

Actions here are illustrative and safe. The real extension asks before consequential actions.

Built by Marktechpost

(function(){

var CH = 'wb-dev-demo';

var SCEN = {

label:"Explain code", req:"ask",

url:"https://github.com/acme/router/blob/main/debounce.js",

prompt:"Explain what this function does",

page:'

📄debounce.js
'+

'

export function debounce(fn, wait) {\n let t;\n return (...args) => {\n'+

' clearTimeout(t);\n t = setTimeout(() => fn(...args), wait);\n };\n}

'+

'

Source file view

',

steps:[{t:'Reading file contents', c:'read_page'}],

result:function(){

return '

What it does

    '+

    '

  • Returns a wrapped version of fn that delays calls.
  • '+

    '

  • Each new call clears the pending timer and restarts it.
  • '+

    '

  • fn runs only after wait ms of no new calls.
  • '+

    '

Follow-up: '+

'How do I use it?

';

steps:[{t:'Preparing an example', c:'scratchpad_write'}],

result:'

Usage

const onSearch = debounce((q) => {\n fetchResults(q);\n}, 300);\n\ninput.addEventListener("input", e => onSearch(e.target.value));
'

label:"Extract API endpoints", req:"ask",

url:"https://docs.acme.dev/api/reference",

prompt:"List every endpoint and its method from this reference",

page:'Acme API Reference

v1

'+

'

List usersGET /v1/users
'+

'

Create userPOST /v1/users
'+

'

Get userGET /v1/users/{id}
'+

'

Update userPATCH /v1/users/{id}
'+

'

Delete userDELETE /v1/users/{id}
'+

'

Health checkGET /v1/health
',

{t:'Reading page structure', c:'get_accessibility_tree'},

{t:'Extracting endpoints', c:'extract_data'}

result:function(){

return '

6 endpoints found

'+

'

'+

'

'+

'

'+

'

'+

'

'+

'

'+

'

GET/v1/users
POST/v1/users
GET/v1/users/{id}
PATCH/v1/users/{id}
DELETE/v1/users/{id}
GET/v1/health

Export as JSON or an OpenAPI stub.

';

research: {

label:"Research a topic", req:"ask",

url:"https://blog.statelib.dev/state-in-2026",

prompt:"Compare these two state libraries and recommend one",

page:'State management in 2026

By A. Rivera · 6 min read

'+

'

Two small libraries dominate new projects: StateLib and Acme Store. '+

'Both are signal-based. They differ on bundle size, server rendering, and devtools.

'+

'

The agent also reads docs.acme-store.dev in the background.

',

{t:'Reading blog.statelib.dev', c:'research_url'},

{t:'Reading docs.acme-store.dev', c:'research_url'}

result:function(){

return '

Summary

    '+

    '

  • Both are signal-based and ship first-class TypeScript types.
  • '+

    '

  • StateLib has a smaller core; Acme Store has stronger SSR support.
  • '+

    '

  • For a server-rendered app, the sources lean Acme Store.
  • '+

    '

Illustrative synthesis from two sources. '+

'Which is smaller?

';

steps:[{t:'Checking published bundle sizes', c:'fetch_url'}],

result:'

Bundle size (illustrative)

'+

'

'+

'

StateLib3.1 kB min+gzip
Acme Store5.4 kB min+gzip
'

label:"Star the repo", req:"act",

url:"https://github.com/acme/router",

prompt:"Star this repository",

page:'

📁acme/router
'+

'

Tiny type-safe router for modern web apps.

'+

''+

'☆ Star · 8.4k'+

'

Signed in as you on GitHub.

',

{t:'Finding the Star control', c:'get_interactive_elements'},

{t:'Capturing visible tab', c:'screenshot', token:true}

approve:"Star this repository on your signed-in GitHub account?",

finishStep:{t:'Clicking Star via the page UI', c:'click_ax'},

onFinish:function(){

var b=document.getElementById('gh-star');

if(b){ b.innerHTML='★ Starred · 8.4k';

b.style.background='#f8faf4'; b.style.borderColor='#cfe6a8'; b.style.color='#4f8a00'; }

result:function(){

return '

Done

Repository starred through the visible UI — not a direct API call.

'+

'

Ran in your authenticated session; no credentials were stored.

';

var order = ['explain','api','research','star'];

var state = { mode:'ask', scen:'explain', running:false, aborted:false };

var timers = [];

var $ = function(id){ return document.getElementById(id); };

function clearTimers(){ timers.forEach(clearTimeout); timers = []; }

function renderChips(){

var box=$('wb-chips'); box.innerHTML='';

order.forEach(function(k){

var s=SCEN[k];

var b=document.createElement('button');

b.className='wb-chip'+(k===state.scen?' on':'');

b.innerHTML=s.label+' · '+(s.req==='act'?'Act':'Ask')+'';

b.onclick=function(){ selectScen(k); };

box.appendChild(b);

function renderMode(){

$('wb-modeseg').querySelectorAll('button').forEach(function(b){ b.classList.toggle('on', b.dataset.mode===state.mode); });

var pill=$('wb-modepill'); pill.textContent=state.mode==='act'?'Act':'Ask';

pill.className='wb-mode-pill '+(state.mode==='act'?'act':'ask');

function selectScen(k){

if(state.running) return;

state.scen=k; var s=SCEN[k];

$('wb-url').textContent=s.url; $('wb-page').innerHTML=s.page; $('wb-input').value=s.prompt;

if(s.req==='act' && state.mode!=='act'){ state.mode='act'; }

renderChips(); renderMode(); resetLog();

function resetLog(){

clearTimers(); state.running=false; state.aborted=false;

$('wb-run').style.display=''; $('wb-run').disabled=false;

var stop=$('wb-stopbtn'); if(stop) stop.remove();

$('wb-log').innerHTML='

Press Run to start. Ask mode is read-only; Act mode can act.
';

function addStep(html){

var d=document.createElement('div'); d.className='wb-step'; d.innerHTML=html;

$('wb-log').appendChild(d); postHeight(); return d;

function showStop(){

var stop=document.createElement('button');

stop.id='wb-stopbtn'; stop.className='wb-stop'; stop.textContent='Stop';

stop.onclick=function(){ state.aborted=true; clearTimers(); finishAbort(); };

$('wb-run').style.display='none'; $('wb-run').parentNode.appendChild(stop);

function hideStop(){ var s=$('wb-stopbtn'); if(s) s.remove(); $('wb-run').style.display=''; $('wb-run').disabled=false; }

function finishAbort(){ state.running=false; hideStop();

addStep('× Stopped by user.'); }

function run(){

if(state.running) return;

var s=SCEN[state.scen];

if(s.req==='act' && state.mode!=='act'){

$('wb-log').innerHTML='';

addStep(' '+

'Ask mode is read-only. Switch to Act mode to run this task.');

state.running=true; state.aborted=false;

$('wb-log').innerHTML=''; $('wb-run').disabled=true; showStop();

var delay=350;

s.steps.forEach(function(st){

timers.push(setTimeout(function(){

if(state.aborted) return;

var el=addStep(' '+st.t+' · '+st.c+'');

timers.push(setTimeout(function(){

if(state.aborted) return;

el.innerHTML=' '+st.t+' · '+st.c+'';

if(st.token) addStep('

Token-conscious: screenshot 2000×1200 '+

'resized & JPEG-compressed → ~380 image tokens (illustrative).

');

postHeight();

delay+=780;

timers.push(setTimeout(function(){

if(state.aborted) return;

if(s.approve){ askApproval(s); } else { finish(s); }

}, delay+150));

function askApproval(s){

var box=document.createElement('div'); box.className='wb-approve';

box.innerHTML='

⚠ Consequential action — '+s.approve+'

'+

'

';

$('wb-log').appendChild(box); postHeight();

box.querySelector('.wb-yes').onclick=function(){ box.remove(); finish(s); };

box.querySelector('.wb-no').onclick=function(){

box.remove(); state.running=false; hideStop();

addStep('× Action cancelled. Nothing was changed.');

function finish(s){

state.running=false; hideStop();

if(s.finishStep){ addStep(' '+s.finishStep.t+' · '+s.finishStep.c+''); }

if(s.onFinish){ try{ s.onFinish(); }catch(e){} }

var r=document.createElement('div'); r.className='wb-result'; r.innerHTML=s.result();

$('wb-log').appendChild(r);

addStep(' Task complete · done');

postHeight();

if(s.follow){ var link=document.getElementById('wb-follow'); if(link) link.onclick=function(e){ e.preventDefault(); runFollow(s); }; }

function runFollow(s){

if(state.running) return; state.running=true; $('wb-run').disabled=true; showStop();

s.follow.steps.forEach(function(st){

timers.push(setTimeout(function(){

if(state.aborted) return;

var el=addStep(' '+st.t+' · '+st.c+'');

timers.push(setTimeout(function(){

if(state.aborted) return;

el.innerHTML=' '+st.t+' · '+st.c+'';

},d)); d+=650;

timers.push(setTimeout(function(){

if(state.aborted) return;

state.running=false; hideStop();

var r=document.createElement('div'); r.className='wb-result'; r.innerHTML=s.follow.result;

$('wb-log').appendChild(r); postHeight();

}, d+150));

$('wb-modeseg').querySelectorAll('button').forEach(function(b){

b.onclick=function(){ if(state.running) return; state.mode=b.dataset.mode; renderMode(); };

$('wb-run').onclick=run;

$('wb-reset').onclick=function(){ state.mode='ask'; selectScen('explain'); };

$('wb-input').addEventListener('keydown',function(e){ if(e.key==='Enter') run(); });

function postHeight(){

var el=document.getElementById('wb-root');

var h=(el?el.offsetHeight:document.body.offsetHeight)+40;

if(window.parent && window.parent!==window){ window.parent.postMessage({wbHeight:h, ch:CH},'*'); }

}catch(e){}

window.postHeight=postHeight;

window.addEventListener('load',function(){ postHeight(); setTimeout(postHeight,300); });

if(window.ResizeObserver){ try{ new ResizeObserver(postHeight).observe(document.getElementById('wb-root')); }catch(e){} }

renderChips(); renderMode(); selectScen('explain');

(function(){

window.addEventListener("message", function(e){

if(e && e.data && e.data.ch === "wb-dev-demo" && typeof e.data.wbHeight === "number"){

var f = document.getElementById("webbrain-frame-2");

if(f){ f.style.height = e.data.wbHeight + "px"; }

WebBrain is available on the Chrome Web Store, Firefox Add-ons, and GitHub. Product details at webbrain website.

Note:Thanks to the Webbrain team for the thought leadership/ Resources for this article. Webbrain team has supported this content/article for promotion.

The post Meet WebBrain: An Open-Source, Local-First AI Browser Agent That Reads Pages and Automates Tasks in Chrome and Firefox appeared first on MarkTechPost.

compartilhar: