Memberscripts by Memberstack

#120 - Device/OS/Browser Conditional Visibility

Show/hide elements based on the device, operating system, or browser that a visitor is using. Also works with and/or statements!

Device Types

ms-code-device-show = "mobile"

Will only show on mobile devices and small tablets, regardless of the operating system.

Something only phones can do
ms-code-device-show = "!mobile"

Will hide on mobile devices and small tablets, regardless of the operating system.

Something phones can't do
ms-code-device-show = "tablet"

Will show on tablets, regardless of the operating system.

Something only tablets can do
ms-code-device-show = "!tablet"

Will hide on tablets, regardless of the operating system.

Something tablets can't do
ms-code-device-show = "desktop"

Will show on laptops, desktops, and any larger device, regardless of the operating system.

Something only desktops can do
ms-code-device-show = "!desktop"

Will hide on desktops/large devices, regardless of the operating system.

Something desktops can't do
ms-code-device-show = "touchdevice"

Will show on any touch device.

Start drawing
ms-code-device-show = "!touchdevice"

Will hide on any touch device.

Start clicking
ms-code-device-show = "landscape"

Will show on any device which is in landscape orientation.

Watch YouTube
ms-code-device-show = "portrait"

Will show on any device which is in portrait orientation.

Watch TikTok

Operating Systems

ms-code-device-show = "ios"

Will show on all devices running iOS - iPhones, iPads, and iPods.

View on App Store
ms-code-device-show = "!ios"

Will hide on all devices running iOS - iPhones, iPads, and iPods.

Open website
ms-code-device-show = "android"

Will show on all devices running an android operating system.

View on Play Store
ms-code-device-show = "!android"

Will hide on all devices running an android operating system.

Open website
ms-code-device-show = "macos"

Will show on all devices running MacOS.

Download for MacOS
ms-code-device-show = "!macos"

Will hide on all devices running MacOS.

Use web app
ms-code-device-show = "windows"

Will show on all devices running Windows.

Download for Windows
ms-code-device-show = "!windows"

Will hide on all devices running Windows.

Use web app
ms-code-device-show = "linux"

Will show on all devices running Linux.

Download for Linux
ms-code-device-show = "!linux"

Will hide on all devices running Linux.

Use web app

Browsers

While we're only showing the positive attributes (without a "!"), you can add the exclamation mark and it will still work as you intend it to!

ms-code-device-show = "chrome"

Will show for anyone using a Chromium-based browser.

Get Chrome Extension
ms-code-device-show = "firefox"

Will show for anyone using Firefox.

Get Firefox Add On
ms-code-device-show = "safari"

Will show for anyone using Safari.

Get Safari Extension
ms-code-device-show = "edge"

Will show for anyone using Microsoft Edge.

Get Edge Extension
ms-code-device-show = "opera"

Will show for anyone using Opera

Get Opera Add On
ms-code-device-show = "ie"

Will show for anyone using a Internet Explorer.

Download a new browser (seriously)

Creating Conditions

When specifying your rules in the attribute values, you can use "&" to create an "and" rule (ex. If the device is MacOS AND is using Opera as a browser), and you can use "|" to create an "or" rule (ex. If the device is Linux OR Windows).