New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

detect-fullscreen-ts

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-fullscreen-ts

Detect if local machine has a fullscreen app running

latest
Source
npmnpm
Version
1.6.1
Version published
Maintainers
1
Created
Source

Forked from https://www.npmjs.com/package/detect-fullscreen

detect-fullscreen-ts - Detect fullscreen windows in node.js

This is some code that tries to detect if the user has a fullscreen window open. It should work pretty well in OSX. It works in Windows but needs some better support for computers with multiple screens. Unfortunately it won't work at all in Linux right now, although I would like to change that.

How To Use It

import isFullscreen from "detect-fullscreen-ts"
console.log(isFullscreen())
=> true/false

How It Works

It works a little differently in OSX and Windows. You can see the code at Fullscreen.css

On OSX, the code iterates through all of the elements visible on the screen. One of these elements might be the Menubar which appears at the top of the screen. If that element doesn't exist, we assume that there's a fullscreen window on that display.

On Windows, the code checks the bounds of the active window. If they meet/exceed the resolution of the screen, we treat it as a fullscreen window.

What Happens With Multiple Displays?

If a computer has multiple displays, and one of them has a fullscreen window, then isFullscreen() will return true.

FAQs

Package last updated on 11 Jan 2023

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