Skip to content

patch: fix script injection location#3281

Open
beenotung wants to merge 1 commit into
ritwickdey:masterfrom
beenotung:patch-inject-script
Open

patch: fix script injection location#3281
beenotung wants to merge 1 commit into
ritwickdey:masterfrom
beenotung:patch-inject-script

Conversation

@beenotung
Copy link
Copy Markdown

@beenotung beenotung commented Mar 30, 2026

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?

[ ] Yes
[x] No

It passed all test cases (test:lint, test:unit, and test: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:

SevereServiceError: Couldn't set up Chromedriver Response code 404 (Not Found)

@pantoaibot
Copy link
Copy Markdown

pantoaibot Bot commented Mar 30, 2026

Do you want me to review this PR? Please comment /review .

@beenotung
Copy link
Copy Markdown
Author

@pantoaibot /review

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.

Live Server Script Injected in the wrong place

1 participant