Skip to content

Commit

Permalink
MWPW-155489 [PEP] Add device type as PEP criteria (#2931)
Browse files Browse the repository at this point in the history
PEP now checks if the the useragent is one of a number of mobile devices.
  • Loading branch information
sharmrj committed Sep 26, 2024
1 parent 78d5895 commit 96edd14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,12 @@ class Gnav {
const state = getMetadata('app-prompt')?.toLowerCase();
const entName = getMetadata('app-prompt-entitlement')?.toLowerCase();
const promptPath = getMetadata('app-prompt-path')?.toLowerCase();
const hasMobileUA = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Touch/i.test(navigator.userAgent);

if (state === 'off'
|| !window.adobeIMS?.isSignedInUser()
|| !isDesktop.matches
|| hasMobileUA
|| !entName?.length
|| !promptPath?.length) return;

Expand Down

0 comments on commit 96edd14

Please sign in to comment.