refactor: use helpers when using the remote module in sandboxed renderers (#15960)

This commit is contained in:
Milan Burda 2018-12-05 19:07:32 +01:00 committed by Shelley Vohr
parent d243a45173
commit ab2a061b59
11 changed files with 46 additions and 28 deletions

View file

@ -6,9 +6,10 @@
// Does not implement predefined messages:
// https://developer.chrome.com/extensions/i18n#overview-predefined
const { nativeRequire } = require('@electron/internal/renderer/remote')
const ipcRenderer = require('@electron/internal/renderer/ipc-renderer-internal')
const fs = require('fs')
const path = require('path')
const fs = nativeRequire('fs')
const path = nativeRequire('path')
let metadata

View file

@ -1,9 +1,9 @@
'use strict'
const fs = require('fs')
const path = require('path')
const { remote } = require('electron')
const { app } = remote
const { getRemote, nativeRequire } = require('@electron/internal/renderer/remote')
const fs = nativeRequire('fs')
const path = nativeRequire('path')
const app = getRemote('app')
const getChromeStoragePath = (storageType, extensionId) => {
return path.join(