get-private-browsing-name
Advanced tools
Comparing version 0.2.0 to 1.0.0
{ | ||
"name": "get-private-browsing-name", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "", | ||
@@ -8,3 +8,4 @@ "main": "index.js", | ||
"test": "jest", | ||
"build": "babel src --out-dir dist" | ||
"build": "babel src --out-dir dist", | ||
"deploy": "babel src --out-dir dist && npm publish" | ||
}, | ||
@@ -11,0 +12,0 @@ "repository": { |
@@ -1,11 +0,35 @@ | ||
### WIP - Under development | ||
![npm](https://img.shields.io/npm/v/get-private-browsing-name) ![npm bundle size](https://img.shields.io/bundlephobia/min/get-private-browsing-name) | ||
## Get Private Browsing Name | ||
A dependency-free micro-package that returns the current browser's name for "private browsing" (Incognito/InPrivate/Private Browsing) and phrase displayed when right clicking on a link. | ||
A micro-package (< 3kb min) that returns the current browser's name for "private browsing" (Incognito/InPrivate/Private Browsing) and phrase displayed when right clicking on a link. | ||
### Installation | ||
Depending on your package manager of choice | ||
- `yarn add get-private-browsing-name`, or | ||
- `npm install get-private-browsing-name` | ||
### Conceptual usage | ||
![image](https://user-images.githubusercontent.com/234593/105451916-7c675880-5cd1-11eb-948f-0ddf27a9c162.png) | ||
### General rule of thumb: | ||
- **Safari MacOs, iOS:** Private Browsing Mode | ||
- **Safari:** Private Browsing Mode | ||
- **Gooogle Chrome:** Incognito Mode | ||
- **Microsoft Edge:** InPrivate Browsing Mode | ||
- **Mozilla Firefox:** Private Browsing | ||
### Test cases | ||
Run `yarn test` to see test cases | ||
| User Agent | Result | | ||
| ---- | --- | | ||
| Chrome on macOS | ✅ Pass | | ||
| Apple iPhone XR (Safari) | ✅ Pass | | ||
| Apple iPhone XS (Chrome) | 🛑 Fail | | ||
| Apple iPhone XS Max (Firefox) | 🛑 Fail | | ||
| Windows 10-based PC using Edge browser | ✅ Pass | | ||
| Windows 7-based PC using a Chrome browser | ✅ Pass | | ||
### Example | ||
```js | ||
// Example Running in Chrome | ||
// Example Running in macOS Chrome | ||
import getPrivateBrowsingName from 'get-private-browsing-name'; | ||
@@ -19,2 +43,3 @@ console.log(getPrivateBrowsingName()); | ||
// macMethod: 'Command⌘+Shift+p', | ||
// detectedMethod: 'Command⌘+Shift+p', | ||
// windowsMethod: 'Ctrl+Shift+p', | ||
@@ -21,0 +46,0 @@ // regex: /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8979
0
47
0