Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-private-browsing-name

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-private-browsing-name

![Build Status](https://img.shields.io/github/workflow/status/taitems/get-private-browsing-name/Tests/master) ![npm](https://img.shields.io/npm/dw/get-private-browsing-name) ![npm](https://img.shields.io/npm/v/get-private-browsing-name) ![npm bundle size]

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status npm npm npm bundle size

Get Private Browsing Name

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

General rule of thumb:

  • Safari: Private Browsing Mode
  • Gooogle Chrome: Incognito Mode
  • Microsoft Edge: InPrivate Browsing Mode
  • Mozilla Firefox: Private Browsing
  • Opera: Private Browsing

Test cases

Run yarn test to see test cases

Example

// Example Running in macOS Chrome
import getPrivateBrowsingName from 'get-private-browsing-name';
console.log(getPrivateBrowsingName());
// Logs the following
// {
//   browser: "chrome",
//   mode: "Incognito",
//   linkMethod: "Open Link in Incognito Window",
//   macMethod: 'Command⌘+Shift+p',
//   detectedMethod: 'Command⌘+Shift+p',
//   windowsMethod: 'Ctrl+Shift+p',
//   regex: /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/
// }

Changelog

1.1.0 - Fixes hard crash. Adds Opera support. Fixes Chrome/Firefox-on-iOS tests.
1.0.0 - Stable release

Keywords

FAQs

Package last updated on 02 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc