iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Draw Tools Error: The specified value "!" does not conform to the required format. #1151

Closed hayeswise closed 7 years ago

hayeswise commented 7 years ago

While debugging issues with my own plugin, I noticed when “IITC plugin: draw tools” (draw-tools.user.js) is loaded and enabled (on in Tampermonkey), the following error is reported in the Chrome console: The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers. jquery.min.js:3

Is anyone else seeing this error?

I'm no expert with this; but, from my investigation, it appears to be associated with the spectrum color picker and the setting of inputTypeColorSupport:

 2783:   inputTypeColorSupport = (function() {
 2784:       var colorInput = $("<input type='color' value='!' />")[0];
 2785:       return colorInput.type === "color" && colorInput.value !== "!";
 2786:   })(),

It appears that jQuery is having issue with the '!' value. Any advice on how to fix this error?

dingram commented 7 years ago

Unfortunately this is how it detects whether the browser actually supports <input type="color">. I've seen it done this way in a couple of other libraries (including Modernizr), so I'm not sure if there is a better method.