less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17k stars 3.41k forks source link

Try fix when script run with TamperMonkey or GreaseMonkey #3655

Closed langren1353 closed 2 years ago

langren1353 commented 2 years ago

When useing TamperMonkey or GreaseMonkey with less.js as a @require resource, sometimes there will be an error. I trace the code found a small problem. At https://github.com/less/less.js/blob/master/packages/less/src/less-browser/utils.js function addDataAttrs param tag may be null, then the script will exec failed. A short if may fix this, will you please add the code to check if tag is null

iChenLei commented 2 years ago

Hi, @langren1353 PR welcome !

langren1353 commented 2 years ago

Well, I submit one RP, hope that would work