File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -356,11 +356,16 @@ export class SettingsPanel {
356356
357357 content = fs . readFileSync ( util . getLocalizedHtmlPath ( "ui/settings.html" ) ) . toString ( ) ;
358358
359- content = content . replace (
360- / { { root} } / g,
361- vscode . Uri . file ( util . extensionPath )
362- . with ( { scheme : 'vscode-resource' } )
363- . toString ( ) ) ;
359+ if ( this . panel && this . panel . webview ) {
360+ const cppImageUri : vscode . Uri = this . panel . webview . asWebviewUri ( vscode . Uri . file ( path . join ( util . extensionPath , 'LanguageCCPP_color_128x.png' ) ) ) ;
361+ content = content . replace (
362+ / { { cpp_ i m a g e _ u r i } } / g,
363+ cppImageUri . toString ( ) ) ;
364+ const settingsJsUri : vscode . Uri = this . panel . webview . asWebviewUri ( vscode . Uri . file ( path . join ( util . extensionPath , 'out/ui/settings.js' ) ) ) ;
365+ content = content . replace (
366+ / { { settings_ j s _ u r i } } / g,
367+ settingsJsUri . toString ( ) ) ;
368+ }
364369
365370 content = content . replace (
366371 / { { nonce} } / g,
Original file line number Diff line number Diff line change 33< html lang ="en ">
44 < head >
55 < meta charset ="utf-8 " />
6- < meta http-equiv ="Content-Security-Policy " content ="style-src 'unsafe-inline'; img-src vscode-resource:; script-src 'nonce-{{nonce}}'; ">
6+ < meta http-equiv ="Content-Security-Policy " content ="style-src 'unsafe-inline'; script-src 'nonce-{{nonce}}'; ">
77
88 < style type ="text/css ">
99 @media (max-width : 1140px ) {
404404 < div style ="height: 90px; display: block ">
405405 < table >
406406 < td >
407- < img src ="{{root}}/LanguageCCPP_color_128x.png " height ="76 " width ="76 " alt ="Microsoft C/C++ Extension " title ="Microsoft C/C++ Extension " style ="padding-right: 10px " data-loc-id-title ="microsoft.c.cpp.extension ">
407+ < img src ="{{cpp_image_uri}} " height ="76 " width ="76 " alt ="Microsoft C/C++ Extension " title ="Microsoft C/C++ Extension " style ="padding-right: 10px " data-loc-id-title ="microsoft.c.cpp.extension ">
408408 </ td >
409409 < td >
410410 < div style ="font-size: 20px; font-weight: 400; line-height: 24px "> Microsoft< br > < span data-loc-id ="c.cpp.extension "> C/C++ Extension</ span > </ div >
676676
677677 </ div > <!-- main end -->
678678
679- < script nonce ="{{nonce}} " src ="{{root}}/out/ui/settings.js "> </ script >
679+ < script nonce ="{{nonce}} " src ="{{settings_js_uri}} "> </ script >
680680
681681</ body >
682682</ html >
You can’t perform that action at this time.
0 commit comments