🐛 Set serialized iframe base URL for realtive URLs using <base>#519
Merged
🐛 Set serialized iframe base URL for realtive URLs using <base>#519
<base>#519Conversation
And use the frame's own baseURI for tests
wwilsman
approved these changes
Aug 23, 2021
Contributor
There was a problem hiding this comment.
Two small changes (I made them for you since you're on vacation).
- We don't actually have to use the
bodyelement to get thebaseURI, we can just pull it off the element passed in (the frame document's root element). - There was some leftover test setup for the removed test. I also changed the tests to use the respective iframe's
baseURI.
🎮
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps [@percy/core](https://github.com/percy/cli/tree/HEAD/packages/core) from 1.3.1 to 1.5.1. - [Release notes](https://github.com/percy/cli/releases) - [Commits](https://github.com/percy/cli/commits/v1.5.1/packages/core) --- updated-dependencies: - dependency-name: "@percy/core" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
Discovered in #507, the regex that was used to parse and covert relative URLs was quite expensive. In that specific issue, it would hang the browser indefinitely.
Instead of trying to use a regex to serialize the full URL into the document, we can skip all of that serialization work by adding a
<base>element to the iframes<head>. This will set the base URL for all relative paths within the iframe.Closes #507