Question About iframe Sandbox Differences Between Dev and Prod #1724
Replies: 1 comment 1 reply
|
Hi @oladimeji-akande — there's no environment-specific iframe sandbox config in Canvas. Dev and prod run identical code paths for building the iframe How the sandbox attribute is decidedCanvas renders the application iframe with a
Why dev vs prod differ for youIt looks like your prod iframe URL isn't actually matching any of your manifest's The matching is a strict, case-insensitive prefix match of the loaded URL against the
Worth comparing side by side, for each environment:
I suspect once you line those up across dev and prod, you'll see prod has a small character-level difference (most likely a missing trailing slash) that's letting it skip the sandbox entirely. Once you correct that, prod will start behaving the same way dev does today — i.e. the navigation error will show up there too. Options for fixing the navigation itselfGiven the current sandbox doesn't allow top-frame navigation by design, you have a few options:
|
Uh oh!
There was an error while loading. Please reload this page.
We’re currently experiencing an issue in the dev environment that does not occur in production. We’re attempting to navigate to a new window from within the Canvas iframe, but we’re encountering the following error in dev only:
“Unsafe attempt to initiate navigation for frame with origin 'https://company-dev.canvasmedical.com/' from frame with URL 'https://dev.company.com/'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.”Could you confirm whether there are any differences in the iframe sandbox settings between the dev and prod Canvas environments?
All reactions