AngleSharp / AngleSharp/AngleSharp.Io

Add StorageManager on navigator.storage

Open
#38 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api enhancement up-for-grabs
Dominant language
C#
Stars
37
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Proposal

Implement a minimal StorageManager surface to expose storage usage and persistence semantics for headless and test scenarios.

Scope:

  • Add navigator.storage getter.
  • Implement estimate returning quota and usage.
  • Implement persist and persisted with platform-injected behavior.
  • Optional extension point for getDirectory compatibility.
    Technical Notes:
  • Use the same service registration pattern as Clipboard and Geolocation.
  • Keep persistence decisions delegated to an injected platform interface.
    Acceptance Criteria:
  • navigator.storage is available when registered.
  • estimate returns deterministic values in tests.
  • persist and persisted map to the injected platform implementation.
  • Full unit test coverage for success and edge cases.
    Out of Scope:
  • Real browser eviction heuristics.
  • Full OPFS implementation in first pass.

Description

Add StorageManager on navigator.storage with a minimal but useful subset: estimate, persist, and persisted. The implementation should be platform-injected to support deterministic behavior in tests and host-specific behavior in production.

Background

This complements existing storage APIs by exposing quota/usage and persistence intent, which are common needs in headless automation and integration test environments. It also creates a bridge toward future OPFS support.

Specification

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the service registration pattern used by Clipboard and Geolocation, then trace how navigator APIs receive platform-injected behavior. Implement the minimal StorageManager surface described in the issue and add unit tests covering deterministic estimate values, persistence success, and edge cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.