fix: ignore non-absolute session preload script paths when sandboxed (#19066)
This commit is contained in:
parent
50b9c7051e
commit
69ea0b4ebf
10 changed files with 46 additions and 64 deletions
|
@ -519,12 +519,10 @@ if (features.isDesktopCapturerEnabled()) {
|
|||
const getPreloadScript = async function (preloadPath) {
|
||||
let preloadSrc = null
|
||||
let preloadError = null
|
||||
if (preloadPath) {
|
||||
try {
|
||||
preloadSrc = (await fs.promises.readFile(preloadPath)).toString()
|
||||
} catch (err) {
|
||||
preloadError = errorUtils.serialize(err)
|
||||
}
|
||||
try {
|
||||
preloadSrc = (await fs.promises.readFile(preloadPath)).toString()
|
||||
} catch (err) {
|
||||
preloadError = errorUtils.serialize(err)
|
||||
}
|
||||
return { preloadPath, preloadSrc, preloadError }
|
||||
}
|
||||
|
@ -532,10 +530,7 @@ const getPreloadScript = async function (preloadPath) {
|
|||
ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts())
|
||||
|
||||
ipcMainUtils.handle('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event) {
|
||||
const preloadPaths = [
|
||||
...(event.sender.session ? event.sender.session.getPreloads() : []),
|
||||
event.sender._getPreloadPath()
|
||||
]
|
||||
const preloadPaths = event.sender._getPreloadPaths()
|
||||
|
||||
return {
|
||||
contentScripts: getContentScripts(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue