问题
I'm getting this warning from Chrome in my Angular 2+ application. Ok, so how am I supposed to go about finding where this issue is occurring in my project with so many data URIs? Wait for it to fail, I suppose? Yikes.
[Deprecation] Using unescaped '#' characters in a data URI body is deprecated and will be removed in M67, around May 2018. Please use '%23' instead. See https://www.chromestatus.com/features/5656049583390720 for more details.
Seems like they should point to the source somehow. Any ideas?
回答1:
If you have inline SVG, look at color references and replace #rrggbb with rgb(R, G, B). It should help.
Source: https://github.com/stylus/stylus/issues/2379
回答2:
In my situation, I noticed that the message was fired when filling a input. So I came up with jquery-validation, disabling it didn't fire the message.
Finally I found out that it is in the bootstrap framework. When an input is validated, a checkbox or cross is added to the HTML. This is done base on a SVG, which holds an attribute fill='#3cb85c'
The hashtag in the fill attribute triggers the message in my situation! Changing the #
to %23
fixes the issue.
来源:https://stackoverflow.com/questions/50615029/unescaped-characters-in-a-data-uri-body-deprecated-how-to-find-in-project