less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Fix for Browser InjectJS when no html.head especially in TamperMonkey and ViolentMonkey

Open langren1353 opened this issue 8 months ago • 2 comments

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
  • [x] 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

langren1353 avatar Mar 06 '25 16:03 langren1353