browsentic 0.4.8 → 0.4.9

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.
@@ -1 +1 @@
1
- {"manifest_version":3,"name":"Browsentic","description":"Reimagine browsing as agentic — driven by the AI agent you already run, in your own logged-in browser.","version":"0.4.8","icons":{"16":"icon/16.png","32":"icon/32.png","48":"icon/48.png","96":"icon/96.png","128":"icon/128.png"},"permissions":["storage","unlimitedStorage","activeTab","sidePanel","contextMenus","alarms","scripting","notifications","debugger","downloads"],"host_permissions":["<all_urls>"],"background":{"service_worker":"background.js"},"action":{"default_title":"Browsentic","default_popup":"popup.html"},"side_panel":{"default_path":"sidepanel.html"},"content_scripts":[{"matches":["*://*/*"],"js":["content-scripts/content.js"]}]}
1
+ {"manifest_version":3,"name":"Browsentic","description":"Reimagine browsing as agentic — driven by the AI agent you already run, in your own logged-in browser.","version":"0.4.9","icons":{"16":"icon/16.png","32":"icon/32.png","48":"icon/48.png","96":"icon/96.png","128":"icon/128.png"},"permissions":["storage","unlimitedStorage","activeTab","sidePanel","contextMenus","alarms","scripting","notifications","debugger","downloads"],"host_permissions":["<all_urls>"],"background":{"service_worker":"background.js"},"action":{"default_title":"Browsentic","default_popup":"popup.html"},"side_panel":{"default_path":"sidepanel.html"},"content_scripts":[{"matches":["*://*/*"],"js":["content-scripts/content.js"]}]}
@@ -5,10 +5,10 @@
5
5
  <meta name="color-scheme" content="dark">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>Browsentic</title>
8
- <script type="module" crossorigin src="/chunks/popup-BBVQYKJE.js"></script>
8
+ <script type="module" crossorigin src="/chunks/popup-B_-2m0P9.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/chunks/rolldown-runtime-Bh1tDfsg.js">
10
- <link rel="modulepreload" crossorigin href="/chunks/globals-DAVXgO1U.js">
11
- <link rel="stylesheet" crossorigin href="/assets/globals-DF66MUxu.css">
10
+ <link rel="modulepreload" crossorigin href="/chunks/globals-C7iS-PkW.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/globals-wMwvQr8A.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
@@ -5,10 +5,10 @@
5
5
  <meta name="color-scheme" content="dark">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>Browsentic Chat</title>
8
- <script type="module" crossorigin src="/chunks/sidepanel-BTSXdzrt.js"></script>
8
+ <script type="module" crossorigin src="/chunks/sidepanel-Bv8WKKVC.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/chunks/rolldown-runtime-Bh1tDfsg.js">
10
- <link rel="modulepreload" crossorigin href="/chunks/globals-DAVXgO1U.js">
11
- <link rel="stylesheet" crossorigin href="/assets/globals-DF66MUxu.css">
10
+ <link rel="modulepreload" crossorigin href="/chunks/globals-C7iS-PkW.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/globals-wMwvQr8A.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browsentic",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Hand your real, logged-in browser to the AI agent you already run. Installs the browser extension, runs the local daemon, and speaks MCP.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: page-scripting
3
+ description: Install a reviewed JavaScript toolkit in the page and call it repeatedly — for batch work and capabilities no tool covers.
4
+ triggers: [each, every, all of them, for all, bulk, batch, repeat, again for, 20, dozens, one by one, tags, rows, entries, items, seek, fast forward, rewind, playback, canvas, video position, inject, script, run code]
5
+ ---
6
+
7
+ The user has turned the **Live tool** switch on for this message. That is what makes these two tools available at all, and it is a deliberate act on their part — they are telling you that writing a small script is a reasonable thing to consider here. It is not an instruction to write one: if the ordinary tools fit, use them.
8
+
9
+ `page_injectCode` installs a small toolkit of functions in the page after the user approves the code, and `page_runCode` calls one of them with fresh arguments — no further prompts, as many times as the job needs.
10
+
11
+ ## When to reach for it — and when not to
12
+
13
+ Reach for it in exactly two situations:
14
+
15
+ 1. **The same steps, three or more times, only the input changing.** Creating 20 tags, archiving every message, renaming a list of files. Ten clicks per item times twenty items is two hundred round trips; one injected `addTag(name)` is one approval and twenty cheap calls.
16
+ 2. **A capability no tool covers.** Seeking a video to a timestamp, reading pixels off a canvas, driving an editor's own JavaScript API. If you find yourself simulating something the page could do in one line of its own code, write that line.
17
+
18
+ Do **not** reach for it when the ordinary tools already fit. A one-off click is `page_clickElement`; two repetitions are still cheaper done directly than approved, installed and called. Reading data out of a page is `page_extractText` or `page_getPageInfo`. The injected path costs a user interruption (the approval), a visible "Browsentic is debugging this browser" bar on every call, and it does not work on Firefox or on a tab with DevTools open — so it has to earn its place.
19
+
20
+ The moment to decide is the moment you notice the repetition: after doing a task once by hand and seeing the same sequence coming again and again, stop and write the function rather than grinding through the loop.
21
+
22
+ ## Writing the toolkit
23
+
24
+ Your code runs once, in the page's main world, after the user approves it. Assign every entry point onto the `tools` object you are given:
25
+
26
+ ```js
27
+ tools.addTag = async (name) => {
28
+ document.querySelector('#new-tag').value = name;
29
+ document.querySelector('#new-tag').dispatchEvent(new Event('input', { bubbles: true }));
30
+ document.querySelector('form.tag-form button[type=submit]').click();
31
+ await new Promise((done) => setTimeout(done, 400));
32
+ return [...document.querySelectorAll('.tag-row .name')].some((el) => el.textContent === name);
33
+ };
34
+ ```
35
+
36
+ Rules that keep it working:
37
+
38
+ - **Data goes in arguments, never in the code.** The user approves the code once; if a value is baked in, changing it means another approval. `tags.forEach` loops belong in your calls to `page_runCode`, not inside the toolkit.
39
+ - **Secrets never go in the code.** The approval prompt shows every character to the user, and a credential does not belong on that screen. Fill credential fields with `page_fillInput`, which handles sealed secrets properly.
40
+ - **Return JSON, and return proof.** A function that acted should return evidence it worked — the created item's name, the new count — so each `page_runCode` result verifies itself. `undefined` teaches you nothing.
41
+ - **Snapshot first.** Build selectors from a fresh `page_getPageInfo`, exactly as you would for a click. Guessed selectors fail after approval, which wastes the user's attention twice.
42
+ - **Write an honest `purpose`.** The one-line purpose is what the user reads before the code; say what it does in their words ("Create GA tags one by one from a list"), not in yours.
43
+
44
+ ## The lifecycle
45
+
46
+ `page_injectCode { purpose, code, call? }` triggers the approval — the user can press **Review** and read the code before deciding. Pass `call` to run the first invocation in the same round trip. Then `page_runCode { function, args }` per item. The toolkit survives page reloads (the approved code is re-installed silently) but is bound to the tab and site it was approved on: navigate to another origin and calls refuse with `TOOLKIT_SCOPE` — inject again there if the job follows.
47
+
48
+ If the approval comes back declined, that is an answer, not an obstacle: fall back to the ordinary tools or ask, never re-submit the same code hoping for a different click. A `CODE_ERROR` result carries the page-side exception — fix the code and inject the corrected version, which is a new approval, so get it right in as few revisions as you can.
49
+
50
+ `LIVE_TOOLS_OFF` means the switch went off between messages. Only the user can turn it back on; say what you would use it for and why, and carry on with the ordinary tools meanwhile.