TraceKit icon indicating copy to clipboard operation
TraceKit copied to clipboard

Electron Regex Fix

Open McPo opened this issue 9 years ago • 1 comments

Hi, the current regex for chrome is

/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|webpack|eval).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i

However Ive noticed in Electron apps at least, theres no guarantee of a file:// prefix. ie Filenames for me are listed as.

/User/Emmet/......

as opposed to

file://User/Emmet/......

Ive changed the regex to

/^\s*at (.*?) ?\(((?:file|https?|\s*|blob|chrome-extension|native|webpack|eval).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i

And now Tracekit is working within Electron.

If any more information is required, let me know.

Thanks, Emmet

McPo avatar Nov 11 '16 17:11 McPo

Hey, could you please submit a pr with an added unit test for this scenario. That would be a huge help

niemyjski avatar Nov 11 '16 18:11 niemyjski