1declare const process: any; 2 3function openFileInEditor(file: string, lineNumber: number) { 4 if (process.env.NODE_ENV !== 'production') { 5 // TODO: This is not a great URL since it now blocks users from accessing the `/open-stack-frame` url in their router 6 // ideally it would be something like `/_devtools/open-stack-frame`. 7 const baseUrl = window.location.protocol + '//' + window.location.host; 8 9 fetch(baseUrl + '/open-stack-frame', { 10 method: 'POST', 11 body: JSON.stringify({ file, lineNumber }), 12 }); 13 } 14} 15 16export default openFileInEditor; 17