patch: fix script injection location#3281
Open
beenotung wants to merge 1 commit into
Open
Conversation
…ate script injection location - fix ritwickdey#3280
|
Do you want me to review this PR? Please comment |
Author
|
@pantoaibot /review |
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.
Use the last matched pattern for and to locate script injection location, to avoid breaking application code.
PR Type
What kind of change does this PR introduce?
[x] Bugfix [ ] Feature [ ] Refactoring (no functional changes, no api changes) [ ] Documentation content changes [ ] Other: <!-- Please describe: -->What is the current behavior?
The current script injection looks for the first occurrence of the
</body>pattern, which may break application code if the user written</body>as part of a string value.Issue Number: #3280
What is the new behavior?
It looks for the last occurrence of
</body>(instead of the first occurrence) for the script injection.Does this PR introduce a breaking change?
It passed all test cases (
test:lint,test:unit, andtest:e2e).Other information
Patched wdio-vscode-service launcher to use ChromeDriver 142.0.7444.265 (matching VS Code 1.113.0's embedded Chrome) for the e2e test to run properly. Otherwise I below error: