File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
pkg/rancher-desktop/window Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -211,14 +211,20 @@ function createView() {
211211 const webPreferences : Electron . WebPreferences = {
212212 nodeIntegration : false ,
213213 contextIsolation : true ,
214- preload : path . join ( paths . resources , 'preload.js' ) ,
215214 sandbox : true ,
216215 additionalArguments : [ JSON . stringify ( hostInfo ) ] ,
217216 } ;
218217
219218 if ( currentExtension ?. id ) {
220219 webPreferences . partition = `persist:rdx-${ currentExtension . id } ` ;
221- const webRequest = Electron . session . fromPartition ( webPreferences . partition ) . webRequest ;
220+ const session = Electron . session . fromPartition ( webPreferences . partition ) ;
221+ const { webRequest } = session ;
222+
223+ session . registerPreloadScript ( {
224+ id : `rdx-preload-${ currentExtension . id } ` ,
225+ filePath : path . join ( paths . resources , 'preload.js' ) ,
226+ type : 'frame' ,
227+ } ) ;
222228
223229 webRequest . onBeforeSendHeaders ( ( details , callback ) => {
224230 const source = details . webContents ?. getURL ( ) ?? '' ;
You can’t perform that action at this time.
0 commit comments