File tree 4 files changed +16
-11
lines changed
4 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 149
149
"@types/yargs" : " ^16.0.0" ,
150
150
"@yarnpkg/lockfile" : " ~1.1.0" ,
151
151
"css-loader" : " ~5.1.1" ,
152
- "electron" : " ^14 .0.0" ,
152
+ "electron" : " ^15 .0.0" ,
153
153
"electron-builder" : " ^22.11.11" ,
154
154
"file-loader" : " ~6.2.0" ,
155
155
"fs-extra" : " ~9.1.0" ,
Original file line number Diff line number Diff line change @@ -190,10 +190,13 @@ app.on('ready', () => {
190
190
} ) ;
191
191
192
192
app . on ( "web-contents-created" , ( _event : any , webContents : WebContents ) => {
193
- // Prevent navigation
193
+ // Prevent navigation to local links on the same page and external links
194
194
webContents . on ( 'will-navigate' , ( event : Event , navigationUrl ) => {
195
- console . warn ( `Navigation is not allowed; attempted navigation to: ${ navigationUrl } ` ) ;
196
- event . preventDefault ( ) ;
195
+ const jlabBaseUrl = `http://localhost:${ appConfig . jlabPort } /` ;
196
+ if ( ! ( navigationUrl . startsWith ( jlabBaseUrl ) && navigationUrl . indexOf ( '#' ) === - 1 ) ) {
197
+ console . warn ( `Navigation is not allowed; attempted navigation to: ${ navigationUrl } ` ) ;
198
+ event . preventDefault ( ) ;
199
+ }
197
200
} ) ;
198
201
199
202
// handle page's beforeunload prompt natively
Original file line number Diff line number Diff line change @@ -403,7 +403,9 @@ class JupyterLabSession {
403
403
title : 'JupyterLab' ,
404
404
webPreferences : {
405
405
nodeIntegration : true ,
406
- contextIsolation : false
406
+ contextIsolation : false ,
407
+ // disable native window open to prevent exposing node.js scripts in popups
408
+ nativeWindowOpen : false
407
409
}
408
410
} ) ;
409
411
Original file line number Diff line number Diff line change 88
88
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f"
89
89
integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==
90
90
91
- " @electron/get@^1.0.1 " :
91
+ " @electron/get@^1.13.0 " :
92
92
version "1.13.1"
93
93
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.13.1.tgz#42a0aa62fd1189638bd966e23effaebb16108368"
94
94
integrity sha512-U5vkXDZ9DwXtkPqlB45tfYnnYBN8PePp1z/XDCupnSpdrxT8/ThCv9WCwPLf9oqiSGZTkH6dx2jDUPuoXpjkcA==
@@ -3364,12 +3364,12 @@ electron-to-chromium@^1.4.17:
3364
3364
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.24.tgz#9cf8a92d5729c480ee47ff0aa5555f57467ae2fa"
3365
3365
integrity sha512-erwx5r69B/WFfFuF2jcNN0817BfDBdC4765kQ6WltOMuwsimlQo3JTEq0Cle+wpHralwdeX3OfAtw/mHxPK0Wg==
3366
3366
3367
- electron@^14 .0.0 :
3368
- version "14.2.3 "
3369
- resolved "https://registry.yarnpkg.com/electron/-/electron-14.2.3. tgz#3facf572c57cefe8ce80154ad3e63f937784644b "
3370
- integrity sha512-7wBqvzUKhK1tw544w3+F8J7NajnqURGC4pH3VFTiBHU5ayiI/oaTTXJxyFLZ54zsR7xwon/3dYEVjIm2i68+Zg ==
3367
+ electron@^15 .0.0 :
3368
+ version "15.3.4 "
3369
+ resolved "https://registry.yarnpkg.com/electron/-/electron-15.3.4. tgz#811e8872f4500b88ad49e005cbe8f93e10676f6d "
3370
+ integrity sha512-GLTE+UEKw1pJehkgpLgXtsHhYqSPp6skSNY1bxnY3dDYBrsPlP3nTEO9YQY2p4eHk+uxFVTXOVy5afcu9fIZ9A ==
3371
3371
dependencies :
3372
- " @electron/get" " ^1.0.1 "
3372
+ " @electron/get" " ^1.13.0 "
3373
3373
" @types/node" " ^14.6.2"
3374
3374
extract-zip "^1.0.3"
3375
3375
You can’t perform that action at this time.
0 commit comments