- 13 May 2025
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Add Whatfix Widgets only within the iFrame of an application
- Updated On 13 May 2025
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
If your application uses iframe or frameset elements and you don’t want to display Whatfix content on the main application, Whatfix enables you to embed widgets, such as Self Help or Tasklists specifically within these iframes.
For example, the Self Help widget shown below is embedded only within the w3schools.com iframe and not the main page of the application.
Here’s how you can embed Whatfix widgets (Self-Help and Task List) in such scenarios:
Open your application in a new window.
In the application script header, add the
top
variable to the Whatfix HTML snippet.top
is a Reserved Window Property which refers to the topmost window in a window hierarchy (e.g., in framesets or iframes). Assigning a value towindow.top
loads the Whatfix JavaScript library and initializes the widget on your web application.
Here’s an example code:<script language='javascript'>window._wfx_settings={"top":window};</script> <script language='javascript' async='true' type='text/javascript' src='//whatfix.com/<your account id>/embed/embed.nocache.js'></script>
Note:
If your application is not a single HTML page loaded in the main browser window. Instead, it's structured in a way where parts of the content or even entire sub-applications are loaded within these embedded frames. Replace
window
withwindow.parent
within the_wfx_settings
object's top property in the above example code:window._wf_settings={"top":window.parent};
Tasklists and Self Help are supported only on the same page in the
live_here
mode.live_here mode
refers to a specific configuration or operational mode within the Whatfix extension where the widgets (Tasklists and Self Help) are intended to interact directly with the elements present on the currently loaded web page where the user is interacting.When you launch Whatfix Flows from Self Help within an iframe, the Flows do not display steps outside your page into sub-windows or external tabs.