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 for Browser InjectJS when no html.head especially in TamperMonkey and ViolentMonkey #4321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

langren1353
Copy link
Contributor

What: Runtime at browser. fix for less.js is inject into browser by TamperMonkey or ViolentMonkey, but there is no head tag or even html tag.

Why: without head tag, less.js won't work proplywork properly. it will throw a error TypeError: head is undefined
image

Checklist:

  • Documentation N/A
  • Added/updated unit tests N/A - all test good, and no need for special test
  • Code complete

PR Reason for: when ViolentMonkey xx.user.js use less.js as a library, they will inject the script to chrome content, at that time webpage head tag or even html tag doesn't exist, and then error happed, then all xxx.user.js won't work.
image

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 6, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 7, 2025
@puckowski
Copy link
Contributor

Looks like CI has an issue.

I previously resolved this issue by pinning the Playwright version used by CI to match package.json, though that may not be the best solution.

I'll try to spend some time this weekend improving CI reliability.

╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     pnpm exec playwright install                                        ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝

@langren1353
Copy link
Contributor Author

  • name: Run unit test
    run: npx playwright install chromium && pnpm run test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants