Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when using iframe loader, setting parentOrigin is not work #693

Open
Snailmar opened this issue May 31, 2024 · 2 comments
Open

when using iframe loader, setting parentOrigin is not work #693

Snailmar opened this issue May 31, 2024 · 2 comments

Comments

@Snailmar
Copy link

image
iframe loader, I used chatbotUiconfig and set shouldLoadConfigFromJsonFile false, there are some questions
1.still load config.json
image
2.parentOrigin is not work, and there is an error chatbot UI failed to load
image

@atjohns
Copy link
Contributor

atjohns commented Jun 4, 2024

Hi apologies for the delayed response, I'm looking into this and the root cause.

@touch-dev-null
Copy link

Any updates with this? It looks like it does not matter what you are going to set exactly for origin on you client:

` <script>

  // The loader constructor supports various configurable options used to
  // control how the component configuration and dependencies are retrieved.
  var loaderOpts = {
    // Point the baseUrl option to the the base URL used to download
    // the chatbot UI files and dependencies.
    // In this example, the base URL is relative to the root path
    // You can also use full URLs:
    //    baseUrl: 'https://iframe-host.example.org/lex-web-ui/'
    baseUrl: '/',

    // enable receiving chatbot UI config from event
    // the event is used as an alternative to passing the chatbot
    // UI via JSON file or via the parameter in the load() function
    shouldLoadConfigFromEvent: true,

    // Controls if it should load minimized production dependecies
    // defaults to true for production builds and false in development
    shouldLoadMinDeps: true,
  }

  // ChatBotUiLoader contains the IframeLoader constructor
  // Instantiate the loader and pass the loader options
  var iframeLoader = new ChatBotUiLoader.IframeLoader(loaderOpts);

  // You can override the chatbot UI config by passing a parameter
  var chatbotUiconfig = {
  // if the iframe page is hosted on a different site,
  // you should configure the parentOrigin and iframeOrigin
    ui: {
      // origin of the parent site where you are including the chatbot UI
      parentOrigin: 'http://localhost2',
      toolbarTitle: 'lalal'
    },`

For example above - parentOrigin will not work unless you change it in S3 bucket. Meanwhile toolbarTitle will overwrite value located in S3 Bucket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants