Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

simple user agent parse js

const browser =
    agent.includes('Firefox/') ? 'firefox'
    : agent.includes('Edg/') ? 'edge'
    : agent.includes('Brave') ? 'brave'
    : agent.includes('Chrome/') ? 'chrome'
    : agent.includes('Safari/') ? 'safari'
    : agent.includes('OPR/') ? 'opera'
    : 'other';
 
PREVIOUS NEXT
Tagged: #simple #user #agent #parse #js
ADD COMMENT
Topic
Name
4+8 =