june07/NiM

Latest Chrome update V76 stopped extension opening up new tab / finding local host

Closed this issue · 23 comments

I have noticed that since the latest update of Chrome V76 the extension is not opening up a new tab automatically for the devtools and looks like it's not picking up the WS as per the screenshot?
image
The work around I have had to do is start the debugger and then open up chrome://inspect then click on the inspect link to open the devtools for that WS.
image

I'll give this a closer look and update as soon as I have more info.

Also please see this post https://june07.com/devtoolscompat and let me know if that helps.

So far I'm unable to duplicate the issue on my end (also Windows). I see you are running NiM 2.0.2... but current is 2.2.1. Maybe try updating your version.

Issue is occurring for me on:

  • OS: OSX 10.14.4 (18E226)
  • NiM: 2.2.1
  • Chrome: Version 76.0.3809.100 (Official Build) (64-bit)

I tried both the devtoolscompat and non-devtoolscompat version.

Inbuilt dev tools still work as expected

same on windows, freshly installed NiM, with/without Dev compat

inspecting the background page shows many Invalid url pattern errors being thrown

ERROR: "<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx/1.10.3 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n"
1091 Unchecked runtime.lastError: Invalid url pattern '<URL>'
background.html:1 Unchecked runtime.lastError: Invalid url pattern 'chrome-devtools://*/*localhost:9229*'

@raduflp Thanks! That was helpful. And looking closer at my Chrome version... I was still on 75 so wasn't affected by it. I upgraded to 76 and sure enough... it broke NiM!

A bug report was opened here: https://bugs.chromium.org/p/chromium/issues/detail?id=991571

If users can star the issue and add any additional details, it may help the Chrome Dev team get a fix pushed out quicker.

In the meantime, I've checked on my other browsers and Vivaldi and Opera (most recent) are working fine with NiM as the underlying Chromium version is still at 75:

  • Vivaldi 2.6.1566.49 (Stable channel) (32-bit)
  • Opera 62.0.3331.109

Browsers not working besides Chrome:

  • Brave,
  • Edge Dev

Ah wicked thanks for the help. I have star the bug issue now too.

While we are waiting on a response from the Chrome Dev team, I've pushed a fix here. The fix currently tests for browser versions and changes the URL scheme based on what it detects. I just pushed it to the Webstore and it should be available in the next hour or so.

To shed more light on the issue, it appears a change was made somewhere in Chromium to redirect chrome-devtools:// urls (which is still what Node is giving out) to the devtools:// scheme instead. I wasn't able to track down why this was done but again, hopefully someone can shed light on that here: https://bugs.chromium.org/p/chromium/issues/detail?id=991571

Please let me know how things are looking on your ends when you update to v2.2.2...
Cheers!

Awesome thanks for the help on this. The tab is now automatically opening again for me as before and working ok.

Glad to do it. Truly. Thank you for using the tool. And here comes the obligatory promotion request...

Please share NiM with your social circle. And if you find the time a simple star rating would be great to get NiM pushing closer to 5⭐s in the Web Store https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj

Thank you so much for the work.
However, I'm still having the issue on

  • Chrome 75.0.3770.142 (Official Build) 64 bit
  • NIM 2.2.2
  • macOS High Sierra 10.13.6

I'm using 75 because upgrading Chrome fails, probably because it is under my company's administration.
Hope I will upgrade it sooner.

スクリーンショット 2019-08-14 14 28 15

Can you connect manually to http://localhost:9229/json if you copy paste that into the browser? This issue looks a bit different to me...

Yes.

[
  {
    "description": "node.js instance",
    "devtoolsFrontendUrl": "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/5883fd9f-f3b4-4f63-aba5-2c845aa9640a",
    "faviconUrl": "https://nodejs.org/static/favicon.ico",
    "id": "5883fd9f-f3b4-4f63-aba5-2c845aa9640a",
    "title": "hoge.js",
    "type": "node",
    "url": "file:///Users/val00362/hoge.js",
    "webSocketDebuggerUrl": "ws://127.0.0.1:9229/5883fd9f-f3b4-4f63-aba5-2c845aa9640a"
  }
]

And if you paste the "devtoolsFrontendUrl" in your browser what happens? Does it work?

Try changing your scheme manually opposite to what it's currently set as:

https://github.com/june07/NiM/blob/master/background.js#L102

If you inspect NiM itself (background.js) you should be able to change that setting.

I didn't include this setting in the UI because I assumed it might cause a run away condition if it was set wrong and I also assumed the >75 test was sufficient... but maybe not...

And if you paste the "devtoolsFrontendUrl" in your browser what happens? Does it work?

It worked. The debug session started.
And then I finally has upgraded Chrome to 76.0.3809.100, but the issue still there. The debug window does not open up automatically.

I'm am testing with newly created Chrome user and NIM is the only extension installed it. Any clue?

image

I'm not sure if you changed the setting per my last message? I suggest uninstalling NiM and installing again, and see if that helps. Considering you said you created a new user... not sure that will help?!

Are you certain no other DevTool tabs are open? If you switch to manual mode and click the Open button manually what happens?

Another idea is to set NiM debugging to verbose and see if that turns up anything.

I just realized the wrench icon (where you set the verbosity level for debugging NiM itself) was missing:

image

I pushed 2.2.3 to the Web Store which fixes that. Clicking on the wrench will show you this link: https://june07.com/nim/debug which explains NiM debugging more.

I increased the verbosity and caught the error:

TypeError: Cannot read property 'split' of undefined
    at background.min.js:1
    at angular.min.js:140
    at m.$digest (angular.min.js:151)
    at m.$apply (angular.min.js:155)
    at k (angular.min.js:106)
    at w (angular.min.js:111)
    at XMLHttpRequest.E.onload (angular.min.js:112)

Then I cloned master and debugged with it. You can see $scope.settings.devToolsCompat == trueand nodeJSONMeta.devtoolsFrontendUrlCompat == undefined

スクリーンショット 2019-08-17 7 34 47

Assigning $scope.settings.devToolsCompat = false fixed the error, and the debug window opened! However strangely, setting DevToolsCompat to Off in the option page of 2.2.3 did not solve the issue.

スクリーンショット 2019-08-17 8 03 25

AH!!! Looks like the devtoolsFrontendUrlCompat was removed somewhere in the node.js code. Pushing a fix for this now.

This is from Node v10.16.0... notice the "devtoolsFrontendUrlCompat"...
image

This is from Node v10.4.0... notice the missing "devtoolsFrontendUrlCompat"...
image

So this change should fix that:
https://github.com/june07/NiM/blob/master/background.js#L423

Change has been pushed to the Web Store as well.

Yes.

[
  {
    "description": "node.js instance",
    "devtoolsFrontendUrl": "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/5883fd9f-f3b4-4f63-aba5-2c845aa9640a",
    "faviconUrl": "https://nodejs.org/static/favicon.ico",
    "id": "5883fd9f-f3b4-4f63-aba5-2c845aa9640a",
    "title": "hoge.js",
    "type": "node",
    "url": "file:///Users/val00362/hoge.js",
    "webSocketDebuggerUrl": "ws://127.0.0.1:9229/5883fd9f-f3b4-4f63-aba5-2c845aa9640a"
  }
]

Your version of Node is also missing the compat url. So fingers crossed this is your fix!

2.2.4 is working, thanks! 😁