New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 789569 link

Starred by 5 users

Issue metadata

Status: Assigned
Owner:
Last visit 28 days ago
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Devtool can't parse sourceUrl on windows

Reported by j3l11...@gmail.com, Nov 29 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. node --inspect ./index.js
2. open the chrome inspector 

What is the expected behavior?
the source panel should display index.js on 'file://' protocol

What went wrong?
the index.js is on 'no domain'

Did this work before? No 

Chrome version: 62.0.3202.94  Channel: stable
OS Version: 10.0
Flash Version: 

refer to
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js?l=539

```
// Support file URL for node.js.
    if (this.target().isNodeJS() && sourceURL && sourceURL.startsWith('/')) {
      var nodeJSPath = sourceURL;
      sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath);
      sourceURL = this._internString(sourceURL);
      this._fileURLToNodeJSPath.set(sourceURL, nodeJSPath);
    } else {
      sourceURL = this._internString(sourceURL);
    }
```
That won't work for Windows file paths. 
unix path is like /usr/index.js , it works
windwos path is lile D:\index.js, it does not works

It shoule be:

```
 if (this.target().isNodeJS() && sourceURL && (sourceURL.startsWith('/') || sourceURL.match(/^[A-Za-z]:\\/))) {
```
 
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 2 by lacm...@gmail.com, Nov 30 2017

Yes! My problem is the same! I've made a proxy to transform path in the websocket communication.

Comment 3 by kozy@chromium.org, Nov 30 2017

Owner: kozy@chromium.org

Comment 4 by kozy@chromium.org, Jan 3 2018

Owner: lushnikov@chromium.org
Andrey, I know that you have a patch! :)

Comment 5 by j3l11...@gmail.com, Jun 27 2018

@lushnikov@chromium.org how is it going ?

Sign in to add a comment