# link-jump-intercept

> 拦截浏览器跳转

Latest version **1.0.2** (published 2021-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install link-jump-intercept
pnpm add link-jump-intercept
yarn add link-jump-intercept
bun add link-jump-intercept
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-09-09 |
| First published | 2021-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | 余聪 |
| Maintainers | moyuyc |
| Keywords | 余聪, link, jump, intercept, link-jump-intercept |

## Links

- npm: https://www.npmjs.com/package/link-jump-intercept
- Repository: https://github.com/imcuttle/link-jump-intercept
- Homepage: https://github.com/imcuttle/link-jump-intercept#readme
- Issues: https://github.com/imcuttle/link-jump-intercept/issues
- npm.io page: https://npm.io/package/link-jump-intercept

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-09-09
- 1.0.1 — 2021-09-08
- 1.0.0 — 2021-09-07

## README

# link-jump-intercept

[![Build status](https://img.shields.io/travis/余聪/link-jump-intercept/master.svg?style=flat-square)](https://travis-ci.com/余聪/link-jump-intercept)
[![Test coverage](https://img.shields.io/codecov/c/github/余聪/link-jump-intercept.svg?style=flat-square)](https://codecov.io/github/余聪/link-jump-intercept?branch=master)
[![NPM version](https://img.shields.io/npm/v/link-jump-intercept.svg?style=flat-square)](https://www.npmjs.com/package/link-jump-intercept)
[![NPM Downloads](https://img.shields.io/npm/dm/link-jump-intercept.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/link-jump-intercept)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)

> 拦截浏览器跳转，包括点击 a 标签，window.open 方法；  
> 一般可以用于拦截测试环境、线上环境互相跳转

## Installation

```bash
npm install link-jump-intercept
# or use yarn
yarn add link-jump-intercept
```

## Usage

```javascript
import { register } from 'link-jump-intercept'

const unregister = register({
  onInterceptors: (nextUrl) => {
    // 阻止跳转线上
    return nextUrl.includes('online') ? false : true
  }
})

// 取消副作用
unregister()
```

## Contributing

- Fork it!
- Create your new branch:  
  `git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:  
  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)

## Authors

This library is written and maintained by 余聪, <a href="mailto:yucong@yuanfudao.com">yucong@yuanfudao.com</a>.

## License

MIT - [余聪](https://github.com/imcuttle) 🐟

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