Skip to content

Commit

Permalink
fix: cannot access nativeTheme via electron.remote
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Nov 3, 2019
1 parent f808f50 commit 879b429
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/browser/api/module-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = [
{ name: 'inAppPurchase' },
{ name: 'Menu' },
{ name: 'MenuItem' },
{ name: 'nativeTheme' },
{ name: 'net' },
{ name: 'netLog' },
{ name: 'Notification' },
Expand Down
8 changes: 4 additions & 4 deletions spec/api-remote-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ ifdescribe(features.isRemoteModuleEnabled())('remote module', () => {
})

describe('remote modules', () => {
it('includes browser process modules as properties', () => {
expect(remote.app.getPath).to.be.a('function')
expect(remote.webContents.getFocusedWebContents).to.be.a('function')
expect(remote.clipboard.readText).to.be.a('function')
it('includes browser process modules as properties', async () => {
const mainModules = await ipcRenderer.invoke('get-modules')
const remoteModules = mainModules.filter(name => remote[name])
expect(remoteModules).to.be.deep.equal(mainModules)
})

it('returns toString() of original function via toString()', () => {
Expand Down
1 change: 1 addition & 0 deletions spec/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ipcMain.on('message', function (event, ...args) {
event.sender.send('message', ...args)
})

ipcMain.handle('get-modules', () => Object.keys(electron))
ipcMain.handle('get-temp-dir', () => app.getPath('temp'))
ipcMain.handle('ping', () => null)

Expand Down

0 comments on commit 879b429

Please sign in to comment.