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

Fix when visual editor URL is relative (missing http://) #1377

Merged
merged 4 commits into from
Jun 30, 2023

Conversation

jdorn
Copy link
Member

@jdorn jdorn commented Jun 20, 2023

Features and Changes

Trims and prepends http:// to relative visual editor URLs in the "Open Visual Editor" button.

Fixes #1376

@github-actions
Copy link

github-actions bot commented Jun 20, 2023

Your preview environment pr-1377-bttf has been deployed with errors.

className="btn btn-sm btn-primary"
onClick={async (e) => {
e.preventDefault();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will changing to an anchor tag and removing preventDefault circumvent the checks we have implemented inside the onClick handler?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It the user right clicks and opens in a new tab, it will bypass the extension check and tracking calls. I was mostly thinking about the experience if you are using a dev build of the chrome extension. The extension check will fail, and it would be nice if there was an easy way to bypass it without modifying code. Open to other ideas. Maybe in the extension modal we can add a small link to continue anyway?

I have a feeling I do have a bug there right now when URL is empty. Need to test this some more.

@jdorn jdorn merged commit ebedade into main Jun 30, 2023
2 of 3 checks passed
@jdorn jdorn deleted the visual-editor-absolute-url branch June 30, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visual editor: autocomplete non-http-prepended URLs
2 participants