Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use opts.preload when Electron version is less than 0.37.3 #13

Merged
merged 1 commit into from May 1, 2016

Conversation

atdrago
Copy link
Contributor

@atdrago atdrago commented May 1, 2016

This PR resolves #11 and suppresses Electron's deprecation warning for the preload property.

  • Use opts.preload when Electron's version is < 0.37.3
  • Use opts.webPreferences.preload when Electron's version is >= 0.37.3

opts.preload = path.join(__dirname, 'renderer-preload')
if (v[0] === 0 && v[1] >= 37) {
// options.preload was deprecated for options.webPreferences.preload in 0.37.3
if (v[0] === 0 && (v[1] <= 36 || (v[1] === 37 && v[2] < 3))) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jprichardson What are you thoughts on this conditional? Each piece could be its own variable if you think that's clearer.

@jprichardson jprichardson merged commit 076ad84 into jprichardson:master May 1, 2016
@jprichardson
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace options.preload with options.webPreferences.preload
2 participants