Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
remove unused and dangerous apis
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Sep 27, 2018
1 parent e755b44 commit 487188c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/renderer/api/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ ipcRenderer.on('ELECTRON_RENDERER_RELEASE_CALLBACK', function (event, id) {

var binding = {}

// Alias to remote.require('electron').xxx.
binding.getBuiltin = function (module) {
return metaToValue(ipcRenderer.sendSync('ELECTRON_BROWSER_GET_BUILTIN', module))
}

// Get current BrowserWindow.
binding.getCurrentWindow = function () {
return metaToValue(ipcRenderer.sendSync('ELECTRON_BROWSER_CURRENT_WINDOW'))
Expand Down Expand Up @@ -331,12 +326,12 @@ binding.unregisterEvents = function (tabID, listener) {
GuestViewInternal.removeListener(tabID, listener)
}

const deprecatedRemoteAPIs = ['Menu', 'shell', 'screen', 'clipboard', 'session', 'BrowserWindow']
const deprecatedRemoteAPIs = ['Menu', 'clipboard']
for (var i = 0, len = deprecatedRemoteAPIs.length; i < len; i++) {
const name = deprecatedRemoteAPIs[i]
Object.defineProperty(binding, name, {
get: function () {
return binding.getBuiltin(name)
return metaToValue(ipcRenderer.sendSync('ELECTRON_BROWSER_GET_BUILTIN', name))
}
})
}
Expand Down

1 comment on commit 487188c

@diracdeltas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Please sign in to comment.