# extra-webextension

> ```sh npm install --save extra-webextension # or yarn add extra-webextension ```

Latest version **0.5.2** (published 2026-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install extra-webextension
pnpm add extra-webextension
yarn add extra-webextension
bun add extra-webextension
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2026-11-18 |
| First published | 2022-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 3 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | BlackGlory |
| Maintainers | black_glory |

## Links

- npm: https://www.npmjs.com/package/extra-webextension
- Repository: https://github.com/BlackGlory/extra-webextension
- Homepage: https://github.com/BlackGlory/extra-webextension#readme
- Issues: https://github.com/BlackGlory/extra-webextension/issues
- npm.io page: https://npm.io/package/extra-webextension

## Dependencies (3)

- [extra-utils](https://npm.io/package/extra-utils.md) ^6.2.0
- [extra-promise](https://npm.io/package/extra-promise.md) ^8.0.1
- [@blackglory/prelude](https://npm.io/package/@blackglory/prelude.md) ^0.5.1

## Recent versions

- 0.5.2 (latest) — 2026-11-18
- 0.5.1 — 2026-11-18
- 0.5.0 — 2026-02-16
- 0.4.0 — 2023-12-20
- 0.3.2 — 2023-06-11
- 0.3.1 — 2023-04-24
- 0.3.0 — 2023-02-26
- 0.2.3 — 2023-02-20
- 0.2.2 — 2023-02-20
- 0.2.1 — 2023-02-20
- 0.2.0 — 2023-02-10
- 0.1.0 — 2022-11-02

## README

# extra-webextension
## Install
```sh
npm install --save extra-webextension
# or
yarn add extra-webextension
```

## API
### getActiveTab
```ts
function getActiveTab(): Promise<chrome.tabs.Tab>
```

### waitForLaunch
```ts
enum LaunchReason {
  Install
, Update
, Enable
, Activate
}

type LaunchDetails =
| { reason: LaunchReason.Install }
| {
    reason: LaunchReason.Update
    previousVersion: string
  }
| { reason: LaunchReason.Enable }
| { reason: LaunchReason.Activate }

function waitForLaunch(): Promise<LaunchDetails>
```

### Storage
```ts
interface IStorage<Structure extends Record<string, unknown>> {
  getItem<Key extends keyof Structure>(
    key: Key
  ): Promise<Structure[Key] | undefined>

  setItem<Key extends keyof Structure>(
    key: Key
  , value: Structure[Key]
  ): Promise<void>

  removeItem(key: keyof Structure): Promise<void>

  clear(): Promise<void>
}
```

#### LocalStorage
```ts
class LocalStorage<
  Structure extends Record<string, unknown>
> implements IStorage<Structure>
```

#### SessionStorage
```ts
class SessionStorage<
  Structure extends Record<string, unknown>
> implements IStorage<Structure>
```

#### StorageWithMemoryCache
```ts
class StorageWithMemoryCache<Structure extends Record<string, unknown>> implements IStorage<Structure> {
  constructor(storage: IStorage<Structure>)
}
```

---
_Source: https://npm.io/package/extra-webextension · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
