I noticed this bug while working on Cookie Monster, a mod for the game Cookie Clicker, and a bug report there.
We import jscolor through npm and our mod functions fine on chrome (and I believe firefox).
However, Safari does not load and indicates a faulty regex expression. When loading our code into the console correct colour coding of the input stops when it reaches the code produced by lines 874-876 in jscolor.js:
parsePaletteValue : function (mixed) {
var vals = [];
if (typeof mixed === 'string') { // input is a string of space separated color values
// rgb() and rgba() may contain spaces too, so let's find all color values by regex
mixed.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/ig, function (val) {
vals.push(val);
});
} else if (Array.isArray(mixed)) { // input is an array of color values
vals = mixed;
}
I think Safari is struggling to understand this regex? I don't immediately see why it would not understand this and a quick search on google also did not indicate any obvious compatibility problems with Safari and regex.
Is this something that could be fixed on your end? Or do we need to do something to make the code work on Safari. It is strange that this does seem to work on chrome and other browsers.
I noticed this bug while working on Cookie Monster, a mod for the game Cookie Clicker, and a bug report there.
We import jscolor through npm and our mod functions fine on chrome (and I believe firefox). However, Safari does not load and indicates a faulty regex expression. When loading our code into the console correct colour coding of the input stops when it reaches the code produced by lines 874-876 in
jscolor.js
:After mini-fication through webpack this becomes:
I think Safari is struggling to understand this regex? I don't immediately see why it would not understand this and a quick search on google also did not indicate any obvious compatibility problems with Safari and regex. Is this something that could be fixed on your end? Or do we need to do something to make the code work on Safari. It is strange that this does seem to work on chrome and other browsers.