File tree 4 files changed +2
-36
lines changed
electron-browser/workbench
electron-sandbox/workbench
4 files changed +2
-36
lines changed Original file line number Diff line number Diff line change 4
4
< head >
5
5
< meta charset ="utf-8 " />
6
6
< meta http-equiv ="Content-Security-Policy " content ="default-src 'none'; img-src 'self' https: data: blob: vscode-remote-resource:; media-src 'none'; frame-src 'self' vscode-webview:; object-src 'self'; script-src 'self' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; connect-src 'self' https: ws:; font-src 'self' https: vscode-remote-resource:; ">
7
- < meta http-equiv ="Content-Security-Policy " content ="require-trusted-types-for 'script'; trusted-types default TrustedFunctionWorkaround ExtensionScripts amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget editorGhostText domLineBreaksComputer editorViewLayer diffReview extensionHostWorker insane notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString webNestedWorkerExtensionHost webWorkerExtensionHost; ">
7
+ < meta http-equiv ="Content-Security-Policy " content ="require-trusted-types-for 'script'; trusted-types TrustedFunctionWorkaround ExtensionScripts amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget editorGhostText domLineBreaksComputer editorViewLayer diffReview extensionHostWorker insane notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString webNestedWorkerExtensionHost webWorkerExtensionHost; ">
8
8
</ head >
9
9
< body aria-label ="">
10
10
</ body >
Original file line number Diff line number Diff line change 68
68
}
69
69
) ;
70
70
71
- // add default trustedTypes-policy for logging and to workaround
72
- // lib/platform limitations
73
- window . trustedTypes ?. createPolicy ( 'default' , {
74
- createHTML ( value ) {
75
- // see https://github.com/electron/electron/issues/27211
76
- // Electron webviews use a static innerHTML default value and
77
- // that isn't trusted. We use a default policy to check for the
78
- // exact value of that innerHTML-string and only allow that.
79
- if ( value === '<!DOCTYPE html><style type="text/css">:host { display: flex; }</style>' ) {
80
- return value ;
81
- }
82
- throw new Error ( 'UNTRUSTED html usage, default trusted types policy should NEVER be reached' ) ;
83
- // console.trace('UNTRUSTED html usage, default trusted types policy should NEVER be reached');
84
- // return value;
85
- }
86
- } ) ;
87
-
88
71
//#region Helpers
89
72
90
73
/**
Original file line number Diff line number Diff line change 4
4
< head >
5
5
< meta charset ="utf-8 " />
6
6
< meta http-equiv ="Content-Security-Policy " content ="default-src 'none'; img-src 'self' https: data: blob: vscode-remote-resource:; media-src 'none'; frame-src 'self' vscode-webview:; object-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' https: ws:; font-src 'self' https: vscode-remote-resource:; ">
7
- < meta http-equiv ="Content-Security-Policy " content ="require-trusted-types-for 'script'; trusted-types default TrustedFunctionWorkaround ExtensionScripts amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget editorGhostText domLineBreaksComputer editorViewLayer diffReview extensionHostWorker insane notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString webNestedWorkerExtensionHost webWorkerExtensionHost; ">
7
+ < meta http-equiv ="Content-Security-Policy " content ="require-trusted-types-for 'script'; trusted-types TrustedFunctionWorkaround ExtensionScripts amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget editorGhostText domLineBreaksComputer editorViewLayer diffReview extensionHostWorker insane notebookRenderer safeInnerHtml standaloneColorizer tokenizeToString webNestedWorkerExtensionHost webWorkerExtensionHost; ">
8
8
</ head >
9
9
< body aria-label ="">
10
10
</ body >
Original file line number Diff line number Diff line change 68
68
}
69
69
) ;
70
70
71
- // add default trustedTypes-policy for logging and to workaround
72
- // lib/platform limitations
73
- window . trustedTypes ?. createPolicy ( 'default' , {
74
- createHTML ( value ) {
75
- // see https://github.com/electron/electron/issues/27211
76
- // Electron webviews use a static innerHTML default value and
77
- // that isn't trusted. We use a default policy to check for the
78
- // exact value of that innerHTML-string and only allow that.
79
- if ( value === '<!DOCTYPE html><style type="text/css">:host { display: flex; }</style>' ) {
80
- return value ;
81
- }
82
- throw new Error ( 'UNTRUSTED html usage, default trusted types policy should NEVER be reached' ) ;
83
- // console.trace('UNTRUSTED html usage, default trusted types policy should NEVER be reached');
84
- // return value;
85
- }
86
- } ) ;
87
-
88
71
//#region Helpers
89
72
90
73
/**
You can’t perform that action at this time.
0 commit comments