How to identify the user browser

Eli Guttman
Tera Guru

Hi,

How can i check if the user is using IE browser? i need to check it in the platform (not in service portal)

If someone if familiar with relevant client script, it will be very helpful.

 

thank you

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi,

You can create an onload catalog client script like below. The variable is_ie will contain a boolean value true/false. If IE, it will store true, otherwise false.

function onLoad() {
   //Type appropriate comment here, and begin script below
   var ua = navigator.userAgent;
  /* MSIE used to detect old browsers and Trident used to newer ones*/
  var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
  console.log("If using internet explorer: "+is_ie);
}

Also attached is the screenshot for reference.

find_real_file.png

 

Kindly mark the comment as a correct answer and also helpful once worked.

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Elig,

in the onload client script use this to know if the browser is IR or not

function onLoad(){

// Internet Explorer 6-11
var isIE = false || !!document.documentMode;

}

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

 

I need to use it in a catalog client script - is that supposed to work?

 

i have tried and and seems like it does not work

Harish KM
Kilo Patron
Kilo Patron

Check this

https://community.servicenow.com/community?id=community_question&sys_id=8f0ac369db5cdbc01dcaf3231f961997&view_source=searchResult

Regards
Harish

Ashvini Kadus1
Kilo Guru

Hi Elig,

If you want to only check if the user is using which IE browse then there is already data recorded in service-now.

You can navigate to System Logs --> Transactions(All user) there you can get identifies the browser and certain system details of the user.

 

Kindly mark correct answer or helpful if it helps you to solve your query.

 

Thank You,

Ashvini k