Preload doesn't load in sandboxed render if preload path contains special chars (#12037)
* Adding missing headers * adding ut * Removing the file path exists check * fixing test * exposing window.require in UT
This commit is contained in:
parent
69e7afee26
commit
2f4fd3324b
3 changed files with 28 additions and 4 deletions
|
@ -1186,7 +1186,24 @@ describe('BrowserWindow module', () => {
|
|||
w.loadURL('file://' + path.join(fixtures, 'api', 'preload.html'))
|
||||
})
|
||||
|
||||
it('exposes "exit" event to preload script', (done) => {
|
||||
it('exposes ipcRenderer to preload script (path has special chars)', function (done) {
|
||||
const preloadSpecialChars = path.join(fixtures, 'module', 'preload-sandboxæø åü.js')
|
||||
ipcMain.once('answer', function (event, test) {
|
||||
assert.equal(test, 'preload')
|
||||
done()
|
||||
})
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
sandbox: true,
|
||||
preload: preloadSpecialChars
|
||||
}
|
||||
})
|
||||
w.loadURL('file://' + path.join(fixtures, 'api', 'preload.html'))
|
||||
})
|
||||
|
||||
it('exposes "exit" event to preload script', function (done) {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue