Top
Add Whatfix Widgets only within the iFrame of an application
  • 13 May 2025
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Add Whatfix Widgets only within the iFrame of an application

  • Dark
    Light
  • PDF

Article summary

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:

  1. Open your application in a new window.

  2. 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 to window.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 with window.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.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.