api-management-developer-portal icon indicating copy to clipboard operation
api-management-developer-portal copied to clipboard

Allow-same-origin flag in custom HTML widgets

Open joanboure opened this issue 3 years ago • 2 comments

Hi, I'm trying to show a Hubspot form embed code in a custom HTML widget:

<html>
<head>
</head>
<body>    
    <div style="display: flex; justify-content: center;width: 550px;margin: 0 auto;">
        <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
        <script>
        hbspt.forms.create({
            portalId: "9999999",
            formId: "xxxx",
            sfdcCampaignId: "yyyy",
        });
        </script>
    </div>    
</body>
</html>

When I try to view in the published developer portal, I get this error at browser's console:

Uncaught DOMException: Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag.
    at Object.getCookie (https://js.hsforms.net/forms/v2.js:1:411482)
    at Object.getUtk (https://js.hsforms.net/forms/v2.js:1:556218)
    at Object.s [as create] (https://js.hsforms.net/forms/v2.js:1:567835)
    at about:srcdoc:9:21

Thanks

joanboure avatar Nov 04 '22 07:11 joanboure

@joanboure, thank you for opening this issue. We will triage it within the next few business days.

ghost avatar Nov 04 '22 07:11 ghost

Hi, thank you for reporting this issue. We're aware of this kind of issues and we're working on a fix. No ETA as of right now though. In the meantime, could you try to use a Custom widget, instead of a Custom HTML widget? Sorry for the inconvenience.

JMach1 avatar Nov 07 '22 21:11 JMach1