Use require('electron') in Electron's code
This commit is contained in:
parent
f9d7e7ce55
commit
1d1f911b09
71 changed files with 265 additions and 250 deletions
|
@ -1,5 +1,6 @@
|
|||
if process.platform is 'linux' and process.type is 'renderer'
|
||||
{remote} = require 'electron'
|
||||
# On Linux we could not access clipboard in renderer process.
|
||||
module.exports = require('remote').require 'clipboard'
|
||||
module.exports = remote.require 'clipboard'
|
||||
else
|
||||
module.exports = process.atomBinding 'clipboard'
|
||||
|
|
|
@ -8,11 +8,12 @@ class CrashReporter
|
|||
start: (options={}) ->
|
||||
{@productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
|
||||
|
||||
app =
|
||||
electron = require 'electron'
|
||||
{app} =
|
||||
if process.type is 'browser'
|
||||
require 'app'
|
||||
electron
|
||||
else
|
||||
require('remote').require 'app'
|
||||
electron.remote.require 'electron'
|
||||
|
||||
@productName ?= app.getName()
|
||||
companyName ?= 'GitHub, Inc'
|
||||
|
|
|
@ -13,3 +13,8 @@ Object.defineProperties exports,
|
|||
shell:
|
||||
enumerable: true
|
||||
get: -> require '../shell'
|
||||
# The internal modules, invisible unless you know their names.
|
||||
CallbacksRegistry:
|
||||
get: -> require '../callbacks-registry'
|
||||
deprecate:
|
||||
get: -> require '../deprecate'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue