Embedding a PDF view in a knowledge base article - iframe code is lost when article is submitted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2024 09:33 AM
We want to be to present the content of a pdf in the knowledge base article. We put in the iframe source code to present the pdf. It works in draft mode. When we submit the article, it loses one line of iframe code: the src line with the url address that references the attachment. Basically, we are experiencing what this guy on youtube experienced and couldn't solve https://youtu.be/wGZ_ADn87wU?si=nXs4jIFf_WC0xB4Y. Thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2024 02:01 PM
Chuck,
You can easily drag and drop a PDF into a KB article with the ServiceNow-native Amaze application available through the ServiceNow Store. Videos, too. Check it out: Amaze Article Builder for ServiceNow by Intellective
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2024 02:53 PM
Hi @Chuck_P ,
This might be due to the HTML Sanitizer Scripts present in the system as the <iframe> tag is not allowed due to possible vulnerability to cross domain attacks.
You need to modify the HTMLSanitizerConfig script include to whitelist iFrame tags.
This screenshot is OOTB config.
Update you need to do-
HTML_WHITELIST : { globalAttributes: { attribute:[], attributeValuePattern:{} }, iframe:{ attribute:["width", "height","src","frameborder","allow","allowfullscreen"], attributeValuePattern:{} }, },
Know more about - https://docs.servicenow.com/bundle/washingtondc-platform-security/page/administer/security/concept/c...
If my response has resolved your query, please consider giving it a thumbs up ‌‌ and marking it as the correct answer‌‌!
Thanks & Regards,
Sanjay Kumar