JoeLighthall
Giga Contributor

We recently upgraded to Fuji and were accessing g_user in a global ui script. However this no longer worked with the upgrade. With Chrome debugging I noticed there were two g_user objects. One in the top frame and another in the main frame. With the upgrade the one accessed in the top frame was partially populated. It did not have fields set like userID. So referencing g_user from a global ui script always selects the g_user object in the top frame. Anyways I added this code to get the g_user object in the main frame.



var mainFrame = document.getElementById('gsft_main');


if (mainFrame) {


  my_guser = mainFrame.contentWindow.g_user;


}



I also tried contacting ServiceNow support and was told g_user is to be used only with client script. Which I understand however I feel this object should not exist as a different object in the top frame.