Skip to content

SafePath is a Baseline-powered spin-off of HakaPath, purpose-built for the Chrome Baseline Hackathon to capture DOM elements and surface reliable XPath & CSS locators backed by Baseline data.

License

Notifications You must be signed in to change notification settings

HakaLab-2025/SafePath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafePath (Baseline Edition)

SafePath is a Baseline-powered spin-off of HakaPath, purpose-built for the Chrome Baseline Hackathon to capture DOM elements and surface reliable XPath & CSS locators backed by Baseline data.

What's Inside

  • Right-click capture flow that opens SafePath from the context menu.
  • Four locator slots per element with hit counters and quick POM snippets.
  • Instant CSS/XPath Baseline hints powered by the datasets in public/.
  • Offline-first: everything runs inside the browser, nothing is sent to external services.

Requirements

  • Chromium browser with Manifest V3 support (Chrome, Edge, Brave).
  • Node.js 18+ only if you need to rebuild the bundle or run the smoke test.

Quick Start

  1. Install dependencies (first time): npm install.
  2. Build the extension: npm run build → outputs to dist/ (and regenerates Baseline data).
  3. Load in Chrome: open chrome://extensions, enable Developer mode, press Load unpacked and pick the dist/ folder.
  4. Pin SafePath, right-click any element, choose Get SafePath, and copy the locator or generated POM snippet you need.

Optional Validation

  • Baseline dataset check: npm run verify:baseline — confirms public/baseline-compat.min.json is in sync with the generated dataset.

Project Layout

  • manifest.json — MV3 manifest and permissions.
  • background.js — service worker: context menu, locator generation, state sync.
  • content_script.js — popup logic, counters, history, POM helpers.
  • background.html — main UI (Bootstrap + FontAwesome).
  • create_pom.js — builds the Page Object Model snippet when you copy locators.
  • baseline-client.js / baseline-hook.js — Baseline compatibility renderer using datasets in public/.
  • CSS/, JS/, IMG/, _locales/ — bundled styles, scripts, icons, and translations.

Useful Scripts

  • npm run build — Rollup build + Baseline dataset refresh.
  • npm run build:watch — rebuild on change while developing.
  • npm run lint — ESLint over the generated bundle.
  • npm run verify:baseline — ensures the Baseline dataset committed matches the regenerated output.
  • npm run baseline:scan — audits JS APIs against Baseline targets.

Need More?

  • Detailed contribution workflow lives in CONTRIBUTE.md.
  • Release notes and previous iterations are tracked in CHANGELOG.md.
  • Questions during the hackathon: contact@hakalab.com or visit hakalab.com/hakapath.

About

SafePath is a Baseline-powered spin-off of HakaPath, purpose-built for the Chrome Baseline Hackathon to capture DOM elements and surface reliable XPath & CSS locators backed by Baseline data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •