# code-snippets/trunk/js/utils/screen.ts

Code Snippets, version trunk. 17 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/trunk/code/js/utils/screen.ts
- Raw: https://pluginprobe.com/plugins/code-snippets/trunk/raw/js/utils/screen.ts
- Modified: 2026-09-22T07:42:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-snippets/trunk/code/js/utils/screen.ts#L10-L20`.

```typescript
// `pagenow` is only defined inside wp-admin. This module is also reached from
// the admin bar bundle, which loads on the front end, so read it defensively.
export const isNetworkAdmin = (): boolean =>
	true === window.pagenow?.endsWith('-network')

export const isMacOS = (): boolean =>
	null !== /mac/i.exec(window.navigator.userAgent)

export const isLicensed = (): boolean =>
	!!window.CODE_SNIPPETS?.isLicensed

export const isCloudConnected = (): boolean =>
	!!window.CODE_SNIPPETS?.isCloudConnected

export const shouldShowUpsell = () =>
	!isLicensed() && !window.CODE_SNIPPETS?.hideUpsell

```
