Skip to content

feat: upgrade detectIncognito to v1.9.0 with all detection fixes - #100

Merged
IntegerAlex merged 5 commits into
mainfrom
chore/update-incognito-bowser
Aug 12, 2026
Merged

IntegerAlex merged 5 commits into
mainfrom
chore/update-incognito-bowser

Conversation

@IntegerAlex

@IntegerAlex IntegerAlex commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Upgrade detectIncognito to v1.9.0 with new per-browser private-mode detection

  • Updates src/incognito.ts to use new detection strategies: Safari via storage.getDirectory/IDB blob checks, Chrome via IndexedDB durability timing with wall-clock and hard timeouts, and Firefox via storage.getDirectory or InvalidStateError on IDB open.
  • detectIncognito now always resolves instead of rejecting — unknown browsers default to non-private, and a callbackSettled guard prevents multiple resolutions.
  • Expands Chromium browser identification to include Chrome, Edge, Opera, and Brave by name, with Bowser-based fallback.
  • Adds detection for Linespider and SlackBot user agents (browser name, version, and platform/vendor classification) in the bundled Bowser parser.
  • Behavioral Change: removes the prior webkitTemporaryStorage and webkitRequestFileSystem quota-based Chrome detection methods in favor of IndexedDB durability timing.

Macroscope summarized 1f6b5af.

@netlify

netlify Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for clever-starlight-3034ea failed. Why did it fail? →

Name Link
🔨 Latest commit 1f6b5af
🔍 Latest deploy log https://app.netlify.com/projects/clever-starlight-3034ea/deploys/6a7c5792782a340007c236f5

@netlify

netlify Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for fingerprint-oss failed. Why did it fail? →

Name Link
🔨 Latest commit 1f6b5af
🔍 Latest deploy log https://app.netlify.com/projects/fingerprint-oss/deploys/6a7c5792ad46be00086bb40c

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added browser and bot recognition for Brave, DuckDuckGo, Linespider, and SlackBot.
    • Added detection for Smart TV and LG NetCast platforms.
  • Bug Fixes
    • Improved private browsing detection across Chrome, Firefox, Safari, Edge, Opera, and Brave.
    • Improved handling of storage errors and prevented duplicate detection results.
  • Chores
    • Updated the package to version 0.10.0.
    • Updated the bundled Bowser version.

Walkthrough

The package updates to 0.10.0. Bowser adds browser aliases and platform descriptors. detectIncognito updates browser detection, storage probes, Safari handling, Firefox handling, and callback settlement.

Changes

Browser detection updates

Layer / File(s) Summary
Incognito detection routing
src/incognito.ts
detectIncognito uses direct user-agent checks, guards callback settlement, updates Safari checks, and awaits Firefox detection.
Browser-specific storage probes
src/incognito.ts
Chrome detection uses IndexedDB durability timing. Firefox detection uses storage-directory or IndexedDB error results with database cleanup.
Browser and platform parser entries
src/bowser/constants.ts, src/bowser/parser-browsers.ts, src/bowser/parser-platforms.ts
Bowser adds Brave, DuckDuckGo, Linespider, and SlackBot mappings and descriptors. Platform parsing adds Linespider, SlackBot, Smart TV, and NetCast detection.
Package and embedded version updates
package.json, src/bowser/bowser.ts
The package version changes to 0.10.0. The Bowser banner changes to v2.14.1.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant detectIncognito
  participant navigator
  participant IndexedDB
  participant callback
  detectIncognito->>navigator: inspect browser and storage APIs
  detectIncognito->>IndexedDB: run browser-specific private-mode probe
  IndexedDB-->>detectIncognito: return timing or error result
  detectIncognito->>callback: resolve once with detection result
Loading

Possibly related PRs

Suggested labels: Review effort 4/5

Poem

A rabbit checks the browser trail,
Brave and SlackBots leave a tale.
IndexedDB drums soft and bright,
Safari stores its clues at night.
New aliases hop into view,
And version numbers spring anew.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: upgrading detectIncognito and applying detection fixes.
Description check ✅ Passed The description directly explains the detectIncognito updates and related Bowser parser changes.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/update-incognito-bowser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as outdated.

@IntegerAlex

Copy link
Copy Markdown
Owner Author

@macroscope-app review

1 similar comment
@IntegerAlex

Copy link
Copy Markdown
Owner Author

@macroscope-app review

@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Manual reviews triggered for commit 1f6b5af:

All prior checks · these links stay valid even if you push more commits.

@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review triggered. The Approvability and Correctness checks are now running. Results will be posted when they complete.

Comment thread src/bowser/parser-platforms.ts
Comment thread src/incognito.ts Outdated
Comment thread src/incognito.ts
@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

This PR rewrites the core incognito detection algorithms - Chrome detection changes from storage quota to IndexedDB durability timing analysis, and Firefox detection is substantially rewritten. These are significant runtime behavior changes to the library's primary functionality that warrant human review.

You can customize Macroscope's approvability policy. Learn more.

- incognito: add hard-deadline watchdog to chromePrivateTest so a stalled
  IndexedDB transaction can never hang detectIncognito/getSystemInfo
- incognito: guard indexedDB.open in try/catch for chrome and firefox paths
- incognito: enforce resolve-only contract by replacing main().catch(reject)
  with a resolving fallback and removing the unused reject parameter
- incognito: use a unique firefox fallback db name, close request.result
  before deleteDatabase, and handle onblocked
- incognito: identifyChromium now falls back to vendored Bowser so
  Chromium-based browsers (Samsung Internet, Vivaldi, ...) are not reported
  as plain Chrome
- bowser platforms: move Smart TV/NetCast detectors before the generic
  Android detectors so Android TV UAs resolve to tv instead of tablet
Comment thread src/incognito.ts
When the hard-deadline watchdog fires after the database is already open,
deleteDatabase was called while a live connection (and its pending
transactions) remained open, so the deletion was never scheduled and storage
stayed contended. Hoist the connection reference into chromePrivateTest scope,
close it (nulling the reference) before deleteDatabase from the watchdog and
onblocked paths, and use a local conn inside onsuccess so all terminal paths
release the handle.
Repository owner deleted a comment from coderabbitai Bot Aug 12, 2026
@IntegerAlex

Copy link
Copy Markdown
Owner Author

@macroscope-app review

@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review triggered. The Approvability and Correctness checks are now running. Results will be posted when they complete.

@IntegerAlex
IntegerAlex merged commit 30b7207 into main Aug 12, 2026
14 of 22 checks passed
@IntegerAlex
IntegerAlex deleted the chore/update-incognito-bowser branch August 12, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant