Home

Debugging Edge (Chromium) extensions with vscode-edge-debug and sourcemaps

%3CLINGO-SUB%20id%3D%22lingo-sub-482996%22%20slang%3D%22en-US%22%3EDebugging%20Edge%20(Chromium)%20extensions%20with%20vscode-edge-debug%20and%20sourcemaps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482996%22%20slang%3D%22en-US%22%3E%3CP%3EHowdy%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20I%20go%20and%20file%20an%20issue%20somewhere%2C%20wanted%20to%20perform%20a%20sanity%20check%20here.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%E2%80%99m%20trying%20to%20debug%20a%20useful%20little%20extension%20for%20Chrome.%20I%20set%20up%20vscode-edge-debug%20with%20an%20Attach%20configuration%2C%20launched%20the%20browser%20with%20remote%20debug%20port%2C%20loaded%20unpacked%20extension%20folder%2C%20and%20attach%20is%20successful.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESourceMap%20loading%2C%20however%2C%20appears%20to%20be%20brokey.%20Snippet%20from%20trace%20log%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%20dir%3D%22ltr%22%3E%5B18%3A17%3A20.690%20UTC%5D%20%E2%86%90%20From%20target%3A%20%7B%22method%22%3A%22Debugger.scriptParsed%22%2C%22params%22%3A%7B%22scriptId%22%3A%22593%22%2C%22url%22%3A%22chrome-extension%3A%2F%2Fnkfgmdgpgabmnjikknfhcnnikpmomkil%2Fcontentscript.js%22%2C%22startLine%22%3A0%2C%22startColumn%22%3A0%2C%22endLine%22%3A3836%2C%22endColumn%22%3A41%2C%22executionContextId%22%3A216%2C%22hash%22%3A%2226a0d10107f9b1fc056a1e7ba7000198243a01ce%22%2C%22executionContextAuxData%22%3A%7B%22isDefault%22%3Afalse%2C%22type%22%3A%22isolated%22%2C%22frameId%22%3A%2205098280A1A2C801335DCFE6218A1931%22%7D%2C%22isLiveEdit%22%3Afalse%2C%22sourceMapURL%22%3A%22contentscript.js.map%22%2C%22hasSourceURL%22%3Afalse%2C%22isModule%22%3Afalse%2C%22length%22%3A131990%7D%7D%3CBR%20%2F%3E%E2%80%A6%3C%2FP%3E%0A%3CP%20dir%3D%22ltr%22%3E%5B18%3A17%3A20.690%20UTC%5D%20SourceMaps.loadSourceMapContents%3A%20Could%20not%20download%20sourcemap%20from%20chrome-extension%3A%2F%2Fnkfgmdgpgabmnjikknfhcnnikpmomkil%2Fcontentscript.js.map%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20if%20I%20paste%20that%20chrome-extension%3A%2F%2F%20sourcemap%20URI%20into%20the%20browser%20window%2C%20it%20works%20fine.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EVersion%2075.0.140.0%20(Official%20build)%20canary%20(64-bit)%3C%2FP%3E%0A%3CP%3EExt%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftomitm%2Flists%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ftomitm%2Flists%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EEntire%20log%20attached.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThoughts%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%2Frafael%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714553%22%20slang%3D%22en-US%22%3ERe%3A%20Debugging%20Edge%20(Chromium)%20extensions%20with%20vscode-edge-debug%20and%20sourcemaps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714553%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F215337%22%20target%3D%22_blank%22%3E%40Rafael%20Rivera%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20was%20great%20information.%20If%20it%20was%20still%20a%20Chrome%20extension%20and%20not%20a%20Microsoft%20Edge%20Insider%20Build%20Extension%20at%20the%20time%2C%20that%20may%20be%20part%20of%20the%20issue.%20Otherwise%2C%20it%20is%20likely%20that%20the%20issue%20is%20corrected%20in%20subsequent%20updates.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGabriel%3C%2FP%3E%3C%2FLINGO-BODY%3E
Rafael Rivera
MVP

Howdy,

 

Before I go and file an issue somewhere, wanted to perform a sanity check here.

 

I’m trying to debug a useful little extension for Chrome. I set up vscode-edge-debug with an Attach configuration, launched the browser with remote debug port, loaded unpacked extension folder, and attach is successful.

 

SourceMap loading, however, appears to be brokey. Snippet from trace log:

 

[18:17:20.690 UTC] ← From target: {"method":"Debugger.scriptParsed","params":{"scriptId":"593","url":"chrome-extension://nkfgmdgpgabmnjikknfhcnnikpmomkil/contentscript.js","startLine":0,"startColumn":0,"endLine":3836,"endColumn":41,"executionContextId":216,"hash":"26a0d10107f9b1fc056a1e7ba7000198243a01ce","executionContextAuxData":{"isDefault":false,"type":"isolated","frameId":"05098280A1A2C801335DCFE6218A1931"},"isLiveEdit":false,"sourceMapURL":"contentscript.js.map","hasSourceURL":false,"isModule":false,"length":131990}}

[18:17:20.690 UTC] SourceMaps.loadSourceMapContents: Could not download sourcemap from chrome-extension://nkfgmdgpgabmnjikknfhcnnikpmomkil/contentscript.js.map

 

But if I paste that chrome-extension:// sourcemap URI into the browser window, it works fine.

 

Version 75.0.140.0 (Official build) canary (64-bit)

Ext: https://github.com/tomitm/lists

Entire log attached.

 

Thoughts?

 

/rafael

1 Reply

@Rafael Rivera 

 

This was great information. If it was still a Chrome extension and not a Microsoft Edge Insider Build Extension at the time, that may be part of the issue. Otherwise, it is likely that the issue is corrected in subsequent updates.

 

Gabriel