refactor: implement Chrome Extension APIs without the remote module (#16686)
* refactor: implement Chrome Extension APIs without the remote module * remove unused potentiallyRemoteRequire
This commit is contained in:
parent
1898f91620
commit
7a3d220347
3 changed files with 79 additions and 77 deletions
|
@ -8,18 +8,3 @@ exports.getRemote = function (name) {
|
|||
}
|
||||
return remote[name]
|
||||
}
|
||||
|
||||
exports.remoteRequire = function (name) {
|
||||
if (!remote) {
|
||||
throw new Error(`${name} requires remote, which is not enabled`)
|
||||
}
|
||||
return remote.require(name)
|
||||
}
|
||||
|
||||
exports.potentiallyRemoteRequire = function (name) {
|
||||
if (process.sandboxed) {
|
||||
return exports.remoteRequire(name)
|
||||
} else {
|
||||
return require(name)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue