Skip to content

Connect streams logs unexpected warnings when third-party scripts and extensions use postMessage #987

Open
@bmitchenko

Description

@bmitchenko

Problem Description

The Amazon Connect streams library appears to be generating warning logs when unrelated third-party scripts and browser extensions send postMessage events within the browser.

Steps to Reproduce

  1. Integrate Amazon Connect streams into a web application
  2. Have third-party scripts (e.g., Stripe) or browser extensions (e.g., Angular DevTools) that use postMessage
  3. Open browser console
  4. Observe warning logs appearing when these third-party scripts or extensions send postMessage events

Current Behavior

Amazon Connect listens to all messages in the browser tab using:

window.addEventListener("message", this.postMessageHandler)

When it receives postMessage events from unrelated sources, it logs:

[siteProxy]: Message came from unexpected iframe. Not a valid CCP. Will not connect

Expected Behavior

The library should handle unrelated postMessage events without generating misleading warning logs in the console.

Environment

  • Browser: Chrome 133.0.6943.143 (Official Build) (64-bit)
  • amazon-connect-streams version: 2.18.1

Image

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions