[RFC] perf: use an internal module resolver to improve require performance (#14633)
* perf: use an internal module resolver instead of relative requires * perf: memoize the results of getting exported Electron properties * perf: make internal module changes consistent across sandboxed / bundled files
This commit is contained in:
parent
73d1b76b54
commit
54ef906832
32 changed files with 156 additions and 73 deletions
|
@ -13,7 +13,7 @@ const matchesPattern = function (pattern) {
|
|||
// Run the code with chrome API integrated.
|
||||
const runContentScript = function (extensionId, url, code) {
|
||||
const context = {}
|
||||
require('./chrome-api').injectTo(extensionId, false, context)
|
||||
require('@electron/internal/renderer/chrome-api').injectTo(extensionId, false, context)
|
||||
const wrapper = `((chrome) => {\n ${code}\n })`
|
||||
const compiledWrapper = runInThisContext(wrapper, {
|
||||
filename: url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue