Closed mariokostelac closed 9 years ago
Configurable how? I would strongly prefer a workaround that doesn't introduce configuration.
I was thinking something like
webContents.executeJavaScript(`${settings.require_fn}('${__dirname}/context-menu').install();`);
having settings.require_fn
set to 'require'
by default.
I think browser-window-created
app event is called before user get any change to load an url on the browser window instance.
The event receive the browser window instance as an argument. We could use this event to save original value of require
and than use that to load the context-menu module.
This way no configuration is needed at all, and user code on page could do wehatever it want to window.require
. I could prepare a PR for this.
:+1:
@parro-it would you create a PR for that or you want me to do that?
@mariokostelac I will, thank you.
If Ember app is wrapped in Electron, original
module
andrequire
globals have to be replaced with ember versions of that. That blocks loading right click context on https://github.com/sindresorhus/electron-debug/blob/master/index.js#L25. Could we makerequire
call configurable?