Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New TAB not working #2130

Open
and27mab opened this issue Jan 16, 2025 · 0 comments
Open

New TAB not working #2130

and27mab opened this issue Jan 16, 2025 · 0 comments

Comments

@and27mab
Copy link

and27mab commented Jan 16, 2025

Hi everyone,

My setup uses an iframe to load WordPress Playground. My problem is that all links with the target “_blank” or absolute URLs open in a new tab, but this new tab doesn’t work.
The URL of the new tab still contains the same “scope” that should identify my installation.

How can I fix this?

Below is the code from the index.html file:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Demo</title>
    <style>
        body {
            display: block;
            margin: 0;
            padding: 0;
            height: 100vh;
            overflow: hidden;
        }
        iframe#wp-playground {
            width: 100%;
            height: 100%;
            border: 0;
        }
    </style>
</head>

<body>
<iframe id="wp-playground" title="Demo"></iframe>
<script type="module">
    import { startPlaygroundWeb } from 'https://playground.wordpress.net/client/index.js';

    const client = await startPlaygroundWeb({
        iframe: document.getElementById('wp-playground'),
        remoteUrl: `https://playground.wordpress.net/remote.html`,
        blueprint: {
            "preferredVersions": {
                "php": "8.0",
                "wp": "6.7"
            },
            "features": { "networking": true },
            "extraLibraries": [ "wp-cli" ],
            "siteOptions": {
                "blogname": "WordPress Playground Demo"
            },
            "plugins": [],
            "landingPage": "/wp-admin/admin.php?page=wc_el_inv-options-page&tab=pop-landing-page",
            "login": true,
            "steps": [
                {
                    "step": "login"
                },
                {
                    "step": "rm",
                    "path": "/wordpress/wp-content/plugins/hello.php"
                },
                {
                    "step": "defineWpConfigConsts",
                    "consts": {
                        "WP_DEBUG": false,
                        "WP_DEBUG_DISPLAY" : false,
                    }
                },
                {
                    "step": "installPlugin",
                    "pluginData": {
                        "resource": "wordpress.org/plugins",
                        "slug": "woocommerce"
                    },
                    "options": {
                        "activate": true
                    }
                },
                {
                    "step": "runPHP",
                    "code": "<?php include 'wordpress/wp-load.php'; delete_transient( '_wc_activation_redirect' );" //elimino il wizard
                },
                {
                    "step": "importWxr",
                    "file": {
                        "resource": "url",
                        "url": "https://raw.githubusercontent.com/wordpress/blueprints/trunk/blueprints/stylish-press/woo-products.wxr"
                    }
                },
                {
                    "step": "setSiteLanguage",
                    "language": "it_IT"
                }
            ],
        },

    });
    await client.isReady();

</script>
</body>

</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

No branches or pull requests

1 participant