Skip to content

Add Cloud support for AvMessage#277

Description

@thutto

馃殌 Feature request

Current Behavior

AvMessage grabs window.location.origin if available. This causes a cross domain error with cloud applications.

Desired Behavior

For Cloud Applications utilize the referrer if available.

Suggested Solution

Create a method in env-var to determine of we are a cloud app.
export function isCloud(windowOverride = window) { const options = getLocationComponents(windowOverride); return !!getCloudEnv(options); }

Modify the domain function of AvMessage to use referrer if we are cloud.
if (document.referrer && isCloud()) { const referrerAnchor = getLocation(document.referrer); return ${referrerAnchor.protocol}//${referrerAnchor.host}; }

Who does this impact? Who is this for?

This is for the Spaces Cloud Effort for the Digital Team.

For MySelf

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions