HeaderEditor icon indicating copy to clipboard operation
HeaderEditor copied to clipboard

[BUG] Quotes in group name completly breaks the options page

Open SpyroTEQ opened this issue 6 years ago • 4 comments

Describe the bug When using quotes in header name, options page JS crashes

Rule and Test address

  1. Create a group named "With Quotes"
  2. Reload the options page
  3. Page displays no rule, while they still are active, becausse console says SyntaxError: '#groups .group-item[data-name=""With Quotes""]' is not a valid selector

Solution: I suspect that the JS code is made using concatenation like document.querySelector('#groups .group-item[data-name="' + headerName + '"]) so either escape the selector content (I don't know how to), or use a proper filter: Array.from(document.querySelectorAll('#groups .group-item')).filter(n => n.dataset['name'] = headerName)...

Extra informations None. -This is blocking because the whole option page is empty (= groups are there, but empty, no rule in it, since JS crashed) so if you have a way to remove the breaking group, it will help me-

[Edit] i've mixed "group" and "rule": quotes in "group" name breaks the page

[Edit2] I've managed to remove the breaking group by changing the data-name value of another group (one that's properly shown) to "With Quotes" and click the "delete" button, so I'm no longer blocked, but the bug still exists

SpyroTEQ avatar May 22 '19 12:05 SpyroTEQ

Please upgrade to 4.x

sylingd avatar May 23 '19 15:05 sylingd

Alright, seems to fix the bug, but I'll stick to v3 anyway because v4 is really utterly slow (typing a letter has like a 300-500ms latency) Thanks tho

SpyroTEQ avatar May 24 '19 09:05 SpyroTEQ

Where do you type?

sylingd avatar May 24 '19 10:05 sylingd

Anywhere: when editing a rule, and putting it in a new group, when setting a rule name/header name/header value. This slowness is not existent on the v3 version. It might come from stuff overlayed on the browser by the company tho, I'll check it again once at home (it cannot be a computer's general slowness as it's a recent i7 3Ghz+ and such).

SpyroTEQ avatar May 24 '19 15:05 SpyroTEQ