Jean-Tinland / simple-bar

A yabai status bar widget for Übersicht
https://www.jeantinland.com/toolbox/simple-bar
MIT License
1.21k stars 129 forks source link

SyntaxError: JSON Parse error: Invalid escape character d #403

Closed geoshapka closed 4 months ago

geoshapka commented 5 months ago

Describe the bug Sometimes If browser tab has \ in it, simple-bar stops working with simple-bar-index.jsx: JSON error ...

To Reproduce Steps to reproduce the behavior:

  1. Open browser window
  2. search for dsa\dsa
  3. See error

Expected behavior simple-bar does not crash

Screenshots 2024-06-05_18-00

Information (please complete the following information):

Additional context Add any other context about the problem here.

error in debug console: [Error] (2) SyntaxError: JSON Parse error: Invalid escape character d — utils.js:6 "{ \"spaces\": [{ \"id\":1, \"uuid\":\"\", \"index\":1, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[335], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":3, \"uuid\":\"CBC652DE-660B-47AF-9AE2-D2A304B59002\", \"index\":2, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[749], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":4, \"uuid\":\"447FA65C-6D62-497B-8942-6AFE3BD41072\", \"index\":3, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":5, \"uuid\":\"B000EC42-BB48-4BF0-9849-1D98ACEA5217\", \"index\":4, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":6, \"uuid\":\"BAEC84A5-52C7-4BB4-89C9-8B4645BFB35D\", \"index\":5, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":7, \"uuid\":\"EF22AA6B-9257-4FBA-8F41-9683882CF7AA\", \"index\":6, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[336], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":8, \"uuid\":\"3BBC5C4A-3A9C-482B-B411-FF2DF91B1A92\", \"index\":7, \"label\":\"\", \"type\":\"float\", \"display\":1, \"windows\":[48029, 2198, 47412], \"first-window\":0, \"last-window\":0, \"has-focus\":true, \"is-visible\":true, \"is-native-fullscreen\":false },{ \"id\":487, \"uuid\":\"C3B0D016-25AC-44C8-AB64-3397AAA6A2FA\", \"index\":8, \"label\":\"\", \"type\":\"float\", \"display\":2, \"windows\":[47806, 47807], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":true, \"is-native-fullscreen\":false },{ \"id\":9, \"uuid\":\"058E116E-9E5B-48AD-8EB0-31382D909881\", \"index\":9, \"label\":\"\", \"type\":\"float\", \"display\":2, \"windows\":[38735], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false },{ \"id\":10, \"uuid\":\"0464A728-A444-4F18-84AB-BDD337F2267B\", \"index\":10, \"label\":\"\", \"type\":\"float\", \"display\":2, \"windows\":[], \"first-window\":0, \"last-window\":0, \"has-focus\":false, \"is-visible\":false, \"is-native-fullscreen\":false }], \"windows\": [{ \"id\":48029, \"pid\":95916, \"app\":\"Firefox\", \"title\":\"dsa\\dsa - Google Search — Private Browsing\", \"scratchpad\":\"\", \"frame\":{ \"x\":4.0000, \"y\":32.0000, \"w\":1916.0000, \"h\":1042.0000 }, \"role\":\"AXWindow\", \"subrole\":\"AXStandardWindow\", \"root-window\":true, \"display\":1, \"space\":7, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":true, \"can-resize\":true, \"has-focus\":true, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":true, \"is-native-fullscreen\":false, \"is-visible\":true, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":2198, \"pid\":95916, \"app\":\"Firefox\", \"title\":\"Mozilla Firefox\", \"scratchpad\":\"\", \"frame\":{ \"x\":2.0000, \"y\":36.0000, \"w\":1916.0000, \"h\":1042.0000 }, \"role\":\"AXWindow\", \"subrole\":\"AXStandardWindow\", \"root-window\":true, \"display\":1, \"space\":7, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":true, \"can-resize\":true, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":true, \"is-native-fullscreen\":false, \"is-visible\":true, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":47806, \"pid\":1137, \"app\":\"Übersicht\", \"title\":\"\", \"scratchpad\":\"\", \"frame\":{ \"x\":-1119.0000, \"y\":117.0000, \"w\":1000.0000, \"h\":650.0000 }, \"role\":\"\", \"subrole\":\"\", \"root-window\":true, \"display\":2, \"space\":8, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":false, \"can-resize\":false, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":false, \"is-native-fullscreen\":false, \"is-visible\":false, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":47807, \"pid\":1137, \"app\":\"Übersicht\", \"title\":\"\", \"scratchpad\":\"\", \"frame\":{ \"x\":-1250.0000, \"y\":275.0000, \"w\":1000.0000, \"h\":650.0000 }, \"role\":\"\", \"subrole\":\"\", \"root-window\":true, \"display\":2, \"space\":8, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":false, \"can-resize\":false, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":false, \"is-native-fullscreen\":false, \"is-visible\":false, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":47412, \"pid\":88448, \"app\":\"Telegram\", \"title\":\"Telegram (201730)\", \"scratchpad\":\"\", \"frame\":{ \"x\":441.0000, \"y\":60.0000, \"w\":1466.0000, \"h\":989.0000 }, \"role\":\"AXWindow\", \"subrole\":\"AXStandardWindow\", \"root-window\":true, \"display\":1, \"space\":7, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":true, \"can-resize\":true, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":true, \"is-native-fullscreen\":false, \"is-visible\":true, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":335, \"pid\":12469, \"app\":\"Google Chrome\", \"title\":\"Best JSON Pretty Print Online - Google Chrome – georgii\", \"scratchpad\":\"\", \"frame\":{ \"x\":0.0000, \"y\":36.0000, \"w\":1920.0000, \"h\":1044.0000 }, \"role\":\"AXWindow\", \"subrole\":\"AXStandardWindow\", \"root-window\":true, \"display\":1, \"space\":1, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":true, \"can-resize\":true, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":true, \"is-native-fullscreen\":false, \"is-visible\":false, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":38735, \"pid\":75605, \"app\":\"app_mode_loader\", \"title\":\"\", \"scratchpad\":\"\", \"frame\":{ \"x\":-1800.0000, \"y\":-10.0000, \"w\":1800.0000, \"h\":1131.0000 }, \"role\":\"\", \"subrole\":\"\", \"root-window\":true, \"display\":2, \"space\":9, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":false, \"can-resize\":false, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":false, \"is-native-fullscreen\":false, \"is-visible\":false, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":336, \"pid\":12469, \"app\":\"Google Chrome\", \"title\":\"\", \"scratchpad\":\"\", \"frame\":{ \"x\":0.0000, \"y\":38.0000, \"w\":1920.0000, \"h\":1042.0000 }, \"role\":\"\", \"subrole\":\"\", \"root-window\":true, \"display\":1, \"space\":6, \"level\":0, \"sub-level\":0, \"layer\":\"normal\", \"sub-layer\":\"normal\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":false, \"can-resize\":false, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":false, \"is-native-fullscreen\":false, \"is-visible\":false, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false },{ \"id\":749, \"pid\":97050, \"app\":\"kitty\", \"title\":\"t\", \"scratchpad\":\"\", \"frame\":{ \"x\":5.0000, \"y\":33.0000, \"w\":1910.0000, \"h\":1042.0000 }, \"role\":\"AXWindow\", \"subrole\":\"AXStandardWindow\", \"root-window\":true, \"display\":1, \"space\":2, \"level\":0, \"sub-level\":-20, \"layer\":\"normal\", \"sub-layer\":\"below\", \"opacity\":1.0000, \"split-type\":\"none\", \"split-child\":\"none\", \"stack-index\":0, \"can-move\":true, \"can-resize\":true, \"has-focus\":false, \"has-shadow\":true, \"has-parent-zoom\":false, \"has-fullscreen-zoom\":false, \"has-ax-reference\":true, \"is-native-fullscreen\":false, \"is-visible\":false, \"is-minimized\":false, \"is-hidden\":false, \"is-floating\":false, \"is-sticky\":false, \"is-grabbed\":false }], \"displays\": [{ \"id\":3, \"uuid\":\"2C6C7136-A500-44D3-A7AA-A31D7A554FE9\", \"index\":1, \"label\":\"\", \"frame\":{ \"x\":0.0000, \"y\":0.0000, \"w\":1920.0000, \"h\":1080.0000 }, \"spaces\":[1, 2, 3, 4, 5, 6, 7], \"has-focus\":true },{ \"id\":1, \"uuid\":\"37D8832A-2D66-02CA-B9F7-8F30A301B230\", \"index\":2, \"label\":\"\", \"frame\":{ \"x\":-1800.0000, \"y\":-48.0000, \"w\":1800.0000, \"h\":1169.0000 }, \"spaces\":[8, 9, 10], \"has-focus\":false }], \"SIP\": \"System Integrity Protection status: unknown (Custom Configuration). Configuration: Apple Internal: disabled Kext Signing: enabled Filesystem Protections: disabled Debugging Restrictions: disabled DTrace Restrictions: enabled NVRAM Protections: disabled BaseSystem Verification: enabled Boot-arg Restrictions: disabled Kernel Integrity Protections: enabled Authenticated Root Requirement: enabled This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.\", \"shadow\": \"float\", \"skhdMode\": {} }" parseJson (simple-bar-index-jsx:9693) render (simple-bar-index-jsx:10344) render (client.js:1:894888) redraw (client.js:1:891051)