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

Remove the "-" in BrowserWindow's option names #3400

Merged
merged 8 commits into from Nov 11, 2015
Merged

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Nov 11, 2015

e.g. min-width => minWidth. Old styles are still accepted for compatibility.

Fix #2397.
Refs #2544.

zcbenz added a commit that referenced this pull request Nov 11, 2015
Remove the "-" in BrowserWindow's option names
@zcbenz zcbenz merged commit e41cf81 into master Nov 11, 2015
@zcbenz zcbenz deleted the browser-window-options branch November 11, 2015 03:29
@etiktin
Copy link
Contributor

etiktin commented Nov 11, 2015

No more quotes around option names LGTM 😄
Shouldn't the docs be updated as well?

@zcbenz
Copy link
Member Author

zcbenz commented Nov 11, 2015

Shouldn't the docs be updated as well?

I forgot that, it has been updated now.

@etiktin
Copy link
Contributor

etiktin commented Nov 11, 2015

Thanks!

@matthiasg
Copy link

just tried to get a preload script running based on the wiki documentation and electron version 0.34.3. i could not get this to work properly.

first webPreferences had still to be called web-preferences and it took me a while to find this thread which showed this was recently added and i assume the electron-quick-start is still referencing an older version.

secondly while i could get node-integration: false to work now (meaning require is not longer in the global page scope, as it should be) i could not get the preload script to work to expose selected modules (such as ipc) to the web application. Should this work ? preload is not well documented.

 mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    'web-preferences': {
      'node-integration': false,
      preload: 'file://' + path.join(__dirname, 'expose-window-apis.js')
    }
  });

expose-window-apis.js

window.ipc = require('ipc');
console.log('window.ipc', window.ipc);

@matthiasg
Copy link

the documentation was a little fuzzy here i got it working see #1753 (comment)

@etiktin
Copy link
Contributor

etiktin commented Nov 17, 2015

This PR was merged after v0.34.3 and it's first available in v0.35.0. For v0.34.3 you should use the older dashed options.
Also the preload script should be an absoulte file path, not file url. Change it to preload: path.join(__dirname, 'expose-window-apis.js').

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.

None yet

3 participants