Error: mainFrame[0].contentDocument is null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2020 02:12 AM
Am integrating servicenow with other site.Say www.example.com.On redirecting from Servicenow to that site there is an error which will be seen i.e Error: mainFrame[0].contentDocument is null
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2020 02:28 AM
Hi Shruti,
you can try below things : $window.document.querySelector or $window.document.getElementById or $window.document.querySelectorAll to query iframe element, which content you need to access. For example, if your custom Service Portal page has only one iframe, you can use $window.document.querySelector("iframe").contentWindow to access the contentWindow. Alternatively, angular.element("iframe")[0].contentWindow should work too.
Regards,
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2020 03:17 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2020 02:31 AM
Hi
Are you using DOM in your script somewhere like document.getElementById
if yes then have you made the below changes to the system property?
glide.script.block.client.globals=false
if no then please do it and test again.
And moreover, if you can elaborate on what you are trying to integrate with, that would be great, as you have posted very little information regarding integration you are trying to achieve.
Thanks and regards
Tanushree Doiphode