code-snippets icon indicating copy to clipboard operation
code-snippets copied to clipboard

window == null to determine if in service portal not working

Open Litwilly opened this issue 4 years ago • 6 comments

I've seen a few references to using window == null when trying to determine if in the platform or service portal. This only seems to work in my Rome PDI if isolate script is set to false

https://github.com/ServiceNowDevProgram/code-snippets/blob/b189fc01a77190556a20894fb56896e6ef44a4b7/Client%20Scripts/Get%20URL%20Parameters/script.js#L4-L14

I've found a workaround by using a try/catch block like the following:

https://github.com/litwi1rm/code-snippets/blob/63e1a015cecc56611aec8e03523e4fc2f631e555/Catalog%20Client%20Script/Clear%20all%20fields/script.js#L11-L24

Has anybody else ran into this?

Litwilly avatar Oct 30 '21 11:10 Litwilly

I want to work on this issue, can you assign me?

abhishek-kumar-91 avatar Oct 03 '23 07:10 abhishek-kumar-91

@abhishek-kumar-91 I have assigned it to you, but for your information, we had a pull request already that contained a fix for it, but we were not able to accept that yet. Since then no updates, so if you do it first, the glory is your 😊. Remember to reference this issue in your PR.

Lacah avatar Oct 03 '23 17:10 Lacah

"To determine the platform or service portal in Rome PDI with script isolation enabled, consider using try/catch blocks for reliable identification." ASSIGN ME THIS #416

rajanarahul93 avatar Oct 04 '23 05:10 rajanarahul93

@abhishek-kumar-91 are you working on this or can I re-assign to @rajanarahul93?

Lacah avatar Oct 06 '23 19:10 Lacah

@Lacah yeah, I am still working on this issue.

abhishek-kumar-91 avatar Oct 06 '23 19:10 abhishek-kumar-91

Hi @abhishek-kumar-91 - just following up to see where this is at, and if you'll be able to do this one?

Want to ensure we keep these moving and open it up to the broader group if needed

SapphicFire avatar Oct 14 '23 13:10 SapphicFire