Skip to content

Links that open in a new tab fail when WordPress Playground runs inside an iframe #3450

@dianeco

Description

@dianeco

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

When WordPress Playground runs inside an iframe, links that are supposed to open in a new tab do not work correctly.

A minimal example is:

<iframe src="https://playground.wordpress.net/"></iframe>

The same issue also occurs when Playground is started through the JavaScript API, since it still runs inside an iframe.

For example, when editing a page and clicking the View Page icon in the top toolbar, a new tab opens but the page does not load. In Chrome, it shows an ERR_FAILED browser error page.

When Playground is opened directly at https://playground.wordpress.net/ outside of an iframe, opening links in a new tab works as expected.

Related issue: #2130

Expected behavior

The link should open the correct destination in a new tab.

Actual behavior

A new tab opens, but the destination page fails to load. In Chrome, the tab shows an ERR_FAILED browser error page.

Steps to reproduce

  1. Embed WordPress Playground in an iframe:
    <iframe src="https://playground.wordpress.net/"></iframe>
  2. Open WordPress admin.
  3. Edit a page.
  4. Click the View Page icon in the top toolbar.

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only this plugin is active.
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions