browser-assistant 2.9.12 → 2.9.14

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.
@@ -2492,17 +2492,20 @@ function mountJournalCountdown(signal) {
2492
2492
  const ide = window.BrowserAssistantCoding?.getOnlineIdeQuestion?.(document, location);
2493
2493
  const journalPage = Boolean(journal?.matches());
2494
2494
  const canNavigate = automationPolicy?.canExecute('navigate', context);
2495
+ const startPractice = !question && canNavigate && adapter?.getStartPractice?.(document);
2495
2496
  const type = journalPage ? 'Journal' : batch && canNavigate ? 'Batch Coding'
2496
2497
  : question?.type === 'code' || (ide && canNavigate) ? 'Coding'
2497
- : question || (canNavigate && adapter?.getStartPractice?.(document)) ? (/quiz/i.test(location.pathname) ? 'Quiz' : 'MCQ')
2498
+ : question || startPractice ? (/quiz/i.test(location.pathname) ? 'Quiz' : 'MCQ')
2498
2499
  : null;
2499
2500
  if (!type) {
2500
2501
  showAutomationNotice('Automation is unavailable on this page.');
2501
2502
  return;
2502
2503
  }
2504
+ const coursePractice = /^\/course\/?$/.test(location.pathname) && Boolean(startPractice);
2503
2505
  const startDirectly = context.target.id === 'local-practice'
2506
+ || type === 'Batch Coding'
2504
2507
  || (type === 'MCQ' && context.target.id === 'ccbp-learning-practice'
2505
- && /^\/(?:default-question|primitive-coding(?:-review)?)\/practice\//.test(location.pathname));
2508
+ && (coursePractice || /^\/(?:default-question|primitive-coding(?:-review)?)\/practice\//.test(location.pathname)));
2506
2509
  if (!startDirectly
2507
2510
  && !window.confirm('Start ' + type + ' automation on this page? It can enter and submit answers as it runs.'))
2508
2511
  return;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Browser Assistant",
4
- "version": "2.9.12",
4
+ "version": "2.9.14",
5
5
  "description": "Scans webpages for MCQs and coding problems. Powered by Groq (cloud) and Ollama (local fallback).",
6
6
  "permissions": [
7
7
  "activeTab",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-assistant",
3
- "version": "2.9.12",
3
+ "version": "2.9.14",
4
4
  "description": "Chrome extension and local Python backend for exploring webpage questions and coding exercises",
5
5
  "license": "MIT",
6
6
  "repository": {
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.12", lifespan=lifespan)
194
+ app = FastAPI(title="Browser Assistant API", version="2.9.14", lifespan=lifespan)
195
195
  install_local_guards(app)
196
196
 
197
197
  @app.exception_handler(HTTPException)