BaristaLabs/chrome-dev-tools-generator

Error 404 with GetBrowserProtocolForChromeVersion and etc.

SmolinsCo opened this issue · 3 comments

Let's look at GetBrowserProtocolForChromeVersion:
https://github.com/BaristaLabs/chrome-dev-tools-generator/blob/master/src/BaristaLabs.ChromeDevTools.Core/Chrome.cs#L148
It uses following URL:
$"https://chromium.googlesource.com/chromium/src/+/{chromeVersion.WebKitVersionHash}/third_party/blink/renderer/core/inspector/browser_protocol.pdl?format=TEXT"
I have Chrome 66.0.3359.139.
{chromeVersion.WebKitVersionHash} is a020eddf0d85fe84d4a6787b304f50aafb670969 in this case.
It is really exist such tree:
https://chromium.googlesource.com/chromium/src/+/a020eddf0d85fe84d4a6787b304f50aafb670969/
Also it has "/thirdparty", "/thirdparty/blink"... but hasn't "/thirdparty/blink/renderer" and next folders.

Conclusion: not each googlesource tree has all required files. Some another way should be used.

Possible work-around:
Open root tree URL. Remember parent tree URL. If current tree hasn't such file - open parent tree URL. And so until file found. But I am hasn't tried it and it is obviously it could take many time.

P.S. I could contribute if you will merge :)

Yeah, so I don’t have insight into how the chromium source tree is maintained, however, what did happen around chrome 68 is that the chromium source tree changed where and how the protocol definition is stored.

Prior to chrome 68, a simple JSON document was kept in source, however after 68, a different format (PDL) is used that requires a small script to run to expand it back into JSON.

Thus, if you’re using the latest version of the generator to generate the definition prior to 68, the PDL file doesn’t exist in the chromium source tree and you’ll need to get a prior version of this generator as well.

You can see the prior method of retrieving the definition here: aec80f9#diff-a25901bacf09831febf2d106fb72a783

(Note that in the checkin comment where it says 38.x it really means 68.x)

HTH,

@Oceanswave Thanks, but why not combine both ways in last generator version?
Or at least describe it in README.md (how to "get a prior version of this generator")

No reason - that’s a good idea. Guess I never expected someone to want to generate the code Chrome version that was not latest and not rely on a previous version of the nuget runtime. I’ll make a note in the readme as you suggest/make the conditional. There’s actual a 3rd condition where the location changed once before (58 perhaps? Need to research)