browser-assistant 2.9.14 → 2.9.16
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/extension/content.js +4 -12
- package/extension/manifest.json +1 -1
- package/package.json +1 -1
- package/server/main.py +1 -1
package/extension/content.js
CHANGED
|
@@ -392,7 +392,7 @@ function mountJournalCountdown(signal) {
|
|
|
392
392
|
if (!window.BrowserAssistantJournal?.matches())
|
|
393
393
|
return;
|
|
394
394
|
selectedTab = 'qa';
|
|
395
|
-
openPanel();
|
|
395
|
+
openPanel('journal-ready');
|
|
396
396
|
}, { signal: lifecycle.signal });
|
|
397
397
|
function getAutomationContext() {
|
|
398
398
|
const target = automationPolicy?.resolveTarget(window.location, document) || null;
|
|
@@ -2393,7 +2393,9 @@ function mountJournalCountdown(signal) {
|
|
|
2393
2393
|
* OPEN the panel. Idempotent: if already open, does nothing.
|
|
2394
2394
|
* Does NOT trigger a scan — just shows the UI.
|
|
2395
2395
|
*/
|
|
2396
|
-
function openPanel() {
|
|
2396
|
+
function openPanel(source) {
|
|
2397
|
+
if (source === 'journal-ready' && directRun?.type === 'Journal')
|
|
2398
|
+
return;
|
|
2397
2399
|
if (!isCollapsed && !isHidden)
|
|
2398
2400
|
return; // already open — no-op
|
|
2399
2401
|
isHidden = false;
|
|
@@ -2501,22 +2503,12 @@ function mountJournalCountdown(signal) {
|
|
|
2501
2503
|
showAutomationNotice('Automation is unavailable on this page.');
|
|
2502
2504
|
return;
|
|
2503
2505
|
}
|
|
2504
|
-
const coursePractice = /^\/course\/?$/.test(location.pathname) && Boolean(startPractice);
|
|
2505
|
-
const startDirectly = context.target.id === 'local-practice'
|
|
2506
|
-
|| type === 'Batch Coding'
|
|
2507
|
-
|| (type === 'MCQ' && context.target.id === 'ccbp-learning-practice'
|
|
2508
|
-
&& (coursePractice || /^\/(?:default-question|primitive-coding(?:-review)?)\/practice\//.test(location.pathname)));
|
|
2509
|
-
if (!startDirectly
|
|
2510
|
-
&& !window.confirm('Start ' + type + ' automation on this page? It can enter and submit answers as it runs.'))
|
|
2511
|
-
return;
|
|
2512
2506
|
const progress = document.querySelector('[data-practice-quiz] #progress')?.textContent;
|
|
2513
2507
|
const total = type === 'Journal' || type === 'Coding' ? 1 : Number(progress?.match(/\bof\s+(\d+)/i)?.[1]) || null;
|
|
2514
2508
|
directRun = { id: crypto.randomUUID(), type, url: location.origin + location.pathname,
|
|
2515
2509
|
started_at: new Date().toISOString(), ended_at: null, total, completed: 0, failed: 0, status: 'Running', revision: 0 };
|
|
2516
2510
|
directRunStarting = true;
|
|
2517
2511
|
saveDirectRun();
|
|
2518
|
-
if (!startDirectly)
|
|
2519
|
-
showAutomationNotice(type + ' automation started.');
|
|
2520
2512
|
const started = startPracticeAutomation();
|
|
2521
2513
|
directRunStarting = false;
|
|
2522
2514
|
updateDirectRun();
|
package/extension/manifest.json
CHANGED
package/package.json
CHANGED
package/server/main.py
CHANGED
|
@@ -191,7 +191,7 @@ async def lifespan(_app: FastAPI):
|
|
|
191
191
|
client.close()
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
app = FastAPI(title="Browser Assistant API", version="2.9.
|
|
194
|
+
app = FastAPI(title="Browser Assistant API", version="2.9.16", lifespan=lifespan)
|
|
195
195
|
install_local_guards(app)
|
|
196
196
|
|
|
197
197
|
@app.exception_handler(HTTPException)
|