bb-browser 0.1.2 → 0.2.2
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/README.md +113 -160
- package/dist/{chunk-YAVLEXUJ.js → chunk-TUO443YI.js} +2 -1
- package/dist/cli.js +1 -1
- package/dist/daemon.js +15 -3
- package/dist/daemon.js.map +1 -1
- package/extension/background.js +166 -90
- package/extension/background.js.map +1 -1
- package/extension/dist/background.js +27 -5
- package/extension/dist/background.js.map +1 -1
- package/extension/dist/manifest.json +1 -0
- package/extension/dist/options.html +26 -0
- package/extension/dist/options.js +19 -0
- package/extension/dist/options.js.map +1 -0
- package/extension/manifest.json +2 -1
- package/extension/options.html +26 -0
- package/extension/options.js +19 -0
- package/extension/options.js.map +1 -0
- package/package.json +1 -1
- /package/dist/{chunk-YAVLEXUJ.js.map → chunk-TUO443YI.js.map} +0 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"description": "Browser automation for AI agents",
|
|
6
6
|
"permissions": ["tabs", "activeTab", "scripting", "debugger", "storage", "alarms"],
|
|
7
7
|
"host_permissions": ["<all_urls>"],
|
|
8
|
+
"options_page": "options.html",
|
|
8
9
|
"background": {
|
|
9
10
|
"service_worker": "background.js",
|
|
10
11
|
"type": "module"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>bb-browser Settings</title>
|
|
6
|
+
<style>
|
|
7
|
+
body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; padding: 24px; max-width: 480px; }
|
|
8
|
+
h1 { font-size: 18px; margin-bottom: 16px; }
|
|
9
|
+
label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
|
|
10
|
+
input { width: 100%; padding: 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
|
|
11
|
+
.hint { font-size: 12px; color: #888; margin-top: 4px; }
|
|
12
|
+
.status { margin-top: 12px; font-size: 13px; }
|
|
13
|
+
.saved { color: #2a7; }
|
|
14
|
+
button { margin-top: 12px; padding: 6px 16px; font-size: 13px; cursor: pointer; }
|
|
15
|
+
</style>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<h1>bb-browser Settings</h1>
|
|
19
|
+
<label for="url">Upstream URL</label>
|
|
20
|
+
<input type="text" id="url" placeholder="http://localhost:19824">
|
|
21
|
+
<div class="hint">Leave empty to use default (http://localhost:19824)</div>
|
|
22
|
+
<button id="save">Save</button>
|
|
23
|
+
<div class="status" id="status"></div>
|
|
24
|
+
<script src="options.js"></script>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const STORAGE_KEY = "upstreamUrl";
|
|
2
|
+
const DEFAULT_URL = "http://localhost:19824";
|
|
3
|
+
const urlInput = document.getElementById("url");
|
|
4
|
+
const saveBtn = document.getElementById("save");
|
|
5
|
+
const statusDiv = document.getElementById("status");
|
|
6
|
+
chrome.storage.sync.get(STORAGE_KEY, (result) => {
|
|
7
|
+
urlInput.value = result[STORAGE_KEY] || "";
|
|
8
|
+
urlInput.placeholder = DEFAULT_URL;
|
|
9
|
+
});
|
|
10
|
+
saveBtn.addEventListener("click", async () => {
|
|
11
|
+
const url = urlInput.value.trim();
|
|
12
|
+
await chrome.storage.sync.set({ [STORAGE_KEY]: url });
|
|
13
|
+
statusDiv.textContent = `Saved. ${url ? `Using: ${url}` : `Using default: ${DEFAULT_URL}`}`;
|
|
14
|
+
statusDiv.className = "status saved";
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
statusDiv.textContent = "";
|
|
17
|
+
}, 3e3);
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../src/options.ts"],"sourcesContent":["const STORAGE_KEY = 'upstreamUrl';\nconst DEFAULT_URL = 'http://localhost:19824';\n\nconst urlInput = document.getElementById('url') as HTMLInputElement;\nconst saveBtn = document.getElementById('save') as HTMLButtonElement;\nconst statusDiv = document.getElementById('status') as HTMLDivElement;\n\n// 加载当前设置\nchrome.storage.sync.get(STORAGE_KEY, (result) => {\n urlInput.value = result[STORAGE_KEY] || '';\n urlInput.placeholder = DEFAULT_URL;\n});\n\nsaveBtn.addEventListener('click', async () => {\n const url = urlInput.value.trim();\n await chrome.storage.sync.set({ [STORAGE_KEY]: url });\n statusDiv.textContent = `Saved. ${url ? `Using: ${url}` : `Using default: ${DEFAULT_URL}`}`;\n statusDiv.className = 'status saved';\n setTimeout(() => { statusDiv.textContent = ''; }, 3000);\n});\n"],"names":[],"mappings":"AAAA,MAAM,WAAA,GAAc,aAAA;AACpB,MAAM,WAAA,GAAc,wBAAA;AAEpB,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,KAAK,CAAA;AAC9C,MAAM,OAAA,GAAU,QAAA,CAAS,cAAA,CAAe,MAAM,CAAA;AAC9C,MAAM,SAAA,GAAY,QAAA,CAAS,cAAA,CAAe,QAAQ,CAAA;AAGlD,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,GAAA,CAAI,WAAA,EAAa,CAAC,MAAA,KAAW;AAC/C,EAAA,QAAA,CAAS,KAAA,GAAQ,MAAA,CAAO,WAAW,CAAA,IAAK,EAAA;AACxC,EAAA,QAAA,CAAS,WAAA,GAAc,WAAA;AACzB,CAAC,CAAA;AAED,OAAA,CAAQ,gBAAA,CAAiB,SAAS,YAAY;AAC5C,EAAA,MAAM,GAAA,GAAM,QAAA,CAAS,KAAA,CAAM,IAAA,EAAK;AAChC,EAAA,MAAM,MAAA,CAAO,QAAQ,IAAA,CAAK,GAAA,CAAI,EAAE,CAAC,WAAW,GAAG,GAAA,EAAK,CAAA;AACpD,EAAA,SAAA,CAAU,WAAA,GAAc,UAAU,GAAA,GAAM,CAAA,OAAA,EAAU,GAAG,CAAA,CAAA,GAAK,CAAA,eAAA,EAAkB,WAAW,CAAA,CAAE,CAAA,CAAA;AACzF,EAAA,SAAA,CAAU,SAAA,GAAY,cAAA;AACtB,EAAA,UAAA,CAAW,MAAM;AAAE,IAAA,SAAA,CAAU,WAAA,GAAc,EAAA;AAAA,EAAI,GAAG,GAAI,CAAA;AACxD,CAAC,CAAA"}
|
package/extension/manifest.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "bb-browser",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"description": "Browser automation for AI agents",
|
|
6
6
|
"permissions": ["tabs", "activeTab", "scripting", "debugger", "storage", "alarms"],
|
|
7
7
|
"host_permissions": ["<all_urls>"],
|
|
8
|
+
"options_page": "options.html",
|
|
8
9
|
"background": {
|
|
9
10
|
"service_worker": "background.js",
|
|
10
11
|
"type": "module"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>bb-browser Settings</title>
|
|
6
|
+
<style>
|
|
7
|
+
body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; padding: 24px; max-width: 480px; }
|
|
8
|
+
h1 { font-size: 18px; margin-bottom: 16px; }
|
|
9
|
+
label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
|
|
10
|
+
input { width: 100%; padding: 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
|
|
11
|
+
.hint { font-size: 12px; color: #888; margin-top: 4px; }
|
|
12
|
+
.status { margin-top: 12px; font-size: 13px; }
|
|
13
|
+
.saved { color: #2a7; }
|
|
14
|
+
button { margin-top: 12px; padding: 6px 16px; font-size: 13px; cursor: pointer; }
|
|
15
|
+
</style>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<h1>bb-browser Settings</h1>
|
|
19
|
+
<label for="url">Upstream URL</label>
|
|
20
|
+
<input type="text" id="url" placeholder="http://localhost:19824">
|
|
21
|
+
<div class="hint">Leave empty to use default (http://localhost:19824)</div>
|
|
22
|
+
<button id="save">Save</button>
|
|
23
|
+
<div class="status" id="status"></div>
|
|
24
|
+
<script src="options.js"></script>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const STORAGE_KEY = "upstreamUrl";
|
|
2
|
+
const DEFAULT_URL = "http://localhost:19824";
|
|
3
|
+
const urlInput = document.getElementById("url");
|
|
4
|
+
const saveBtn = document.getElementById("save");
|
|
5
|
+
const statusDiv = document.getElementById("status");
|
|
6
|
+
chrome.storage.sync.get(STORAGE_KEY, (result) => {
|
|
7
|
+
urlInput.value = result[STORAGE_KEY] || "";
|
|
8
|
+
urlInput.placeholder = DEFAULT_URL;
|
|
9
|
+
});
|
|
10
|
+
saveBtn.addEventListener("click", async () => {
|
|
11
|
+
const url = urlInput.value.trim();
|
|
12
|
+
await chrome.storage.sync.set({ [STORAGE_KEY]: url });
|
|
13
|
+
statusDiv.textContent = `Saved. ${url ? `Using: ${url}` : `Using default: ${DEFAULT_URL}`}`;
|
|
14
|
+
statusDiv.className = "status saved";
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
statusDiv.textContent = "";
|
|
17
|
+
}, 3e3);
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../src/options.ts"],"sourcesContent":["const STORAGE_KEY = 'upstreamUrl';\nconst DEFAULT_URL = 'http://localhost:19824';\n\nconst urlInput = document.getElementById('url') as HTMLInputElement;\nconst saveBtn = document.getElementById('save') as HTMLButtonElement;\nconst statusDiv = document.getElementById('status') as HTMLDivElement;\n\n// 加载当前设置\nchrome.storage.sync.get(STORAGE_KEY, (result) => {\n urlInput.value = result[STORAGE_KEY] || '';\n urlInput.placeholder = DEFAULT_URL;\n});\n\nsaveBtn.addEventListener('click', async () => {\n const url = urlInput.value.trim();\n await chrome.storage.sync.set({ [STORAGE_KEY]: url });\n statusDiv.textContent = `Saved. ${url ? `Using: ${url}` : `Using default: ${DEFAULT_URL}`}`;\n statusDiv.className = 'status saved';\n setTimeout(() => { statusDiv.textContent = ''; }, 3000);\n});\n"],"names":[],"mappings":"AAAA,MAAM,WAAA,GAAc,aAAA;AACpB,MAAM,WAAA,GAAc,wBAAA;AAEpB,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,KAAK,CAAA;AAC9C,MAAM,OAAA,GAAU,QAAA,CAAS,cAAA,CAAe,MAAM,CAAA;AAC9C,MAAM,SAAA,GAAY,QAAA,CAAS,cAAA,CAAe,QAAQ,CAAA;AAGlD,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,GAAA,CAAI,WAAA,EAAa,CAAC,MAAA,KAAW;AAC/C,EAAA,QAAA,CAAS,KAAA,GAAQ,MAAA,CAAO,WAAW,CAAA,IAAK,EAAA;AACxC,EAAA,QAAA,CAAS,WAAA,GAAc,WAAA;AACzB,CAAC,CAAA;AAED,OAAA,CAAQ,gBAAA,CAAiB,SAAS,YAAY;AAC5C,EAAA,MAAM,GAAA,GAAM,QAAA,CAAS,KAAA,CAAM,IAAA,EAAK;AAChC,EAAA,MAAM,MAAA,CAAO,QAAQ,IAAA,CAAK,GAAA,CAAI,EAAE,CAAC,WAAW,GAAG,GAAA,EAAK,CAAA;AACpD,EAAA,SAAA,CAAU,WAAA,GAAc,UAAU,GAAA,GAAM,CAAA,OAAA,EAAU,GAAG,CAAA,CAAA,GAAK,CAAA,eAAA,EAAkB,WAAW,CAAA,CAAE,CAAA,CAAA;AACzF,EAAA,SAAA,CAAU,SAAA,GAAY,cAAA;AACtB,EAAA,UAAA,CAAW,MAAM;AAAE,IAAA,SAAA,CAAU,WAAA,GAAc,EAAA;AAAA,EAAI,GAAG,GAAI,CAAA;AACxD,CAAC,CAAA"}
|
package/package.json
CHANGED
|
File without changes
|