File tree 2 files changed +9
-1
lines changed
src/vs/workbench/contrib/webview/browser/pre
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 111
111
onMessage : hostMessaging . onMessage . bind ( hostMessaging ) ,
112
112
ready : workerReady ,
113
113
fakeLoad : ! onElectron ,
114
+ onElectron : onElectron ,
114
115
rewriteCSP : onElectron
115
116
? ( csp ) => {
116
117
return csp . replace ( / v s c o d e - r e s o u r c e : (? = ( \s | ; | $ ) ) / g, 'vscode-webview-resource:' ) ;
Original file line number Diff line number Diff line change 13
13
* onIframeLoaded?: (iframe: HTMLIFrameElement) => void,
14
14
* fakeLoad?: boolean,
15
15
* rewriteCSP: (existingCSP: string, endpoint?: string) => string,
16
+ * onElectron?: boolean
16
17
* }} WebviewHost
17
18
*/
18
19
286
287
// make sure we block the browser from dispatching it. Instead VS Code
287
288
// handles these events and will dispatch a copy/paste back to the webview
288
289
// if needed
289
- if ( isCopyPasteOrCut ( e ) || isUndoRedo ( e ) ) {
290
+ if ( isUndoRedo ( e ) ) {
290
291
e . preventDefault ( ) ;
292
+ } else if ( isCopyPasteOrCut ( e ) ) {
293
+ if ( host . onElectron ) {
294
+ e . preventDefault ( ) ;
295
+ } else {
296
+ return ; // let the browser handle this
297
+ }
291
298
}
292
299
293
300
host . postMessage ( 'did-keydown' , {
You can’t perform that action at this time.
0 commit comments