diff --git a/packages/playground/website/cypress/e2e/blueprints.cy.ts b/packages/playground/website/cypress/e2e/blueprints.cy.ts index f42828f188..294458ae2c 100644 --- a/packages/playground/website/cypress/e2e/blueprints.cy.ts +++ b/packages/playground/website/cypress/e2e/blueprints.cy.ts @@ -42,6 +42,15 @@ describe('Blueprints', () => { cy.wordPressDocument().its('body').should('contain.text', 'My Sites'); }); + it('Base64-encoded Blueprints should work', () => { + const blueprint: Blueprint = { + landingPage: '/', + steps: [{ step: 'enableMultisite' }], + }; + cy.visit('/#' + btoa(JSON.stringify(blueprint))); + cy.wordPressDocument().its('body').should('contain.text', 'My Sites'); + }); + it('enableMultisite step should re-activate the importer plugin', () => { const blueprint: Blueprint = { landingPage: '/wp-admin/plugins.php', diff --git a/packages/playground/website/src/lib/resolve-blueprint.ts b/packages/playground/website/src/lib/resolve-blueprint.ts index f39b454362..172db24e24 100644 --- a/packages/playground/website/src/lib/resolve-blueprint.ts +++ b/packages/playground/website/src/lib/resolve-blueprint.ts @@ -22,7 +22,11 @@ export async function resolveBlueprint() { * /#{"landingPage": "/?p=4"} */ try { - blueprint = JSON.parse(fragment); + try { + blueprint = JSON.parse(atob(fragment)); + } catch (e) { + blueprint = JSON.parse(fragment); + } // Allow overriding the preferred versions using query params // generated by the version switchers. if (query.get('php') || query.get('wp')) {