Resolve conflicts

This commit is contained in:
Jessica Lord 2015-09-10 12:09:37 -07:00
commit 7c287d565d
32 changed files with 146 additions and 177 deletions

View file

@ -29,6 +29,7 @@ possible with your report. If you can, please include:
* Include screenshots and animated GIFs in your pull request whenever possible.
* Follow the CoffeeScript, JavaScript, C++ and Python [coding style defined in docs](/docs/development/coding-style.md).
* Write documentation in [Markdown](https://daringfireball.net/projects/markdown).
See the [Documentation Styleguide](/docs/styleguide.md).
* Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages-styleguide).
## Styleguides

View file

@ -4,7 +4,7 @@
[![devDependency Status](https://david-dm.org/atom/electron/dev-status.svg)](https://david-dm.org/atom/electron#info=devDependencies)
[![Join the Electron Community on Slack](http://atom-slack.herokuapp.com/badge.svg)](http://atom-slack.herokuapp.com/)
:zap: *formerly known as Atom Shell* :zap:
:zap: *Formerly known as Atom Shell* :zap:
The Electron framework lets you write cross-platform desktop applications
using JavaScript, HTML and CSS. It is based on [io.js](http://iojs.org) and
@ -15,7 +15,8 @@ Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
announcements.
This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0).
By participating, you are expected to uphold this code. Please report unacceptable behavior to atom@github.com.
By participating, you are expected to uphold this code. Please report
unacceptable behavior to atom@github.com.
## Downloads
@ -54,7 +55,12 @@ contains documents describing how to build and contribute to Electron.
## Community
There is an [`electron` category on the Atom forums](http://discuss.atom.io/category/electron)
as well as an `#atom-shell` channel on Freenode.
You can ask questions and interact with the community in the following
locations:
- [`electron`](http://discuss.atom.io/category/electron) category on the Atom
forums
- `#atom-shell` channel on Freenode
- [`Atom`](http://atom-slack.herokuapp.com/) channel on Slack
Check out [awesome-electron](https://github.com/sindresorhus/awesome-electron) for a community maintained list of useful example apps, tools and resources.
Check out [awesome-electron](https://github.com/sindresorhus/awesome-electron)
for a community maintained list of useful example apps, tools and resources.

View file

@ -4,7 +4,7 @@
'product_name%': 'Electron',
'company_name%': 'GitHub, Inc',
'company_abbr%': 'github',
'version%': '0.32.1',
'version%': '0.32.2',
},
'includes': [
'filenames.gypi',

View file

@ -388,7 +388,7 @@ void WebContents::DidFailProvisionalLoad(
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) {
Emit("did-fail-load", error_code, error_description);
Emit("did-fail-load", error_code, error_description, validated_url);
}
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
@ -396,7 +396,7 @@ void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) {
Emit("did-fail-load", error_code, error_description);
Emit("did-fail-load", error_code, error_description, validated_url);
}
void WebContents::DidStartLoading() {

View file

@ -17,7 +17,7 @@
<key>CFBundleIconFile</key>
<string>atom.icns</string>
<key>CFBundleVersion</key>
<string>0.32.1</string>
<string>0.32.2</string>
<key>LSMinimumSystemVersion</key>
<string>10.8.0</string>
<key>NSMainNibFile</key>

View file

@ -56,8 +56,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,32,1,0
PRODUCTVERSION 0,32,1,0
FILEVERSION 0,32,2,0
PRODUCTVERSION 0,32,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -74,12 +74,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "0.32.1"
VALUE "FileVersion", "0.32.2"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "0.32.1"
VALUE "ProductVersion", "0.32.2"
VALUE "SquirrelAwareVersion", "1"
END
END

View file

@ -7,7 +7,7 @@
#define ATOM_MAJOR_VERSION 0
#define ATOM_MINOR_VERSION 32
#define ATOM_PATCH_VERSION 1
#define ATOM_PATCH_VERSION 2
#define ATOM_VERSION_IS_RELEASE 1

View file

@ -6,7 +6,7 @@ requestId = 0
WEB_VIEW_EVENTS =
'load-commit': ['url', 'isMainFrame']
'did-finish-load': []
'did-fail-load': ['errorCode', 'errorDescription']
'did-fail-load': ['errorCode', 'errorDescription', 'validatedUrl']
'did-frame-finish-load': ['isMainFrame']
'did-start-loading': []
'did-stop-loading': []

View file

@ -75,6 +75,7 @@
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'WARNING_CFLAGS': [
'-Wno-unknown-warning-option',
'-Wno-parentheses-equality',
'-Wno-unused-function',
'-Wno-sometimes-uninitialized',

View file

@ -1,32 +1,32 @@
## Guides
* [Application distribution](tutorial/application-distribution.md)
* [Application packaging](tutorial/application-packaging.md)
* [Using native node modules](tutorial/using-native-node-modules.md)
* [Debugging main process](tutorial/debugging-main-process.md)
* [Application Distribution](tutorial/application-distribution.md)
* [Application Packaging](tutorial/application-packaging.md)
* [Using Native Node Modules](tutorial/using-native-node-modules.md)
* [Debugging Main Process](tutorial/debugging-main-process.md)
* [Using Selenium and WebDriver](tutorial/using-selenium-and-webdriver.md)
* [DevTools extension](tutorial/devtools-extension.md)
* [Using pepper flash plugin](tutorial/using-pepper-flash-plugin.md)
* [DevTools Extension](tutorial/devtools-extension.md)
* [Using Pepper Flash Plugin](tutorial/using-pepper-flash-plugin.md)
## Tutorials
* [Quick start](tutorial/quick-start.md)
* [Desktop environment integration](tutorial/desktop-environment-integration.md)
* [Online/offline event detection](tutorial/online-offline-events.md)
* [Quick Start](tutorial/quick-start.md)
* [Desktop Environment Integration](tutorial/desktop-environment-integration.md)
* [Online/Offline Event Detection](tutorial/online-offline-events.md)
## API references
## API References
* [Synopsis](api/synopsis.md)
* [Process object](api/process.md)
* [Supported Chrome command line switches](api/chrome-command-line-switches.md)
* [Process Object](api/process.md)
* [Supported Chrome Command Line Switches](api/chrome-command-line-switches.md)
Custom DOM elements:
### Custom DOM Elements:
* [`File` object](api/file-object.md)
* [`<webview>` tag](api/web-view-tag.md)
* [`window.open` function](api/window-open.md)
* [`File` Object](api/file-object.md)
* [`<webview>` Tag](api/web-view-tag.md)
* [`window.open` Function](api/window-open.md)
Modules for the main process:
### Modules for the Main Process:
* [app](api/app.md)
* [auto-updater](api/auto-updater.md)
@ -41,16 +41,16 @@ Modules for the main process:
* [power-save-blocker](api/power-save-blocker.md)
* [protocol](api/protocol.md)
* [session](api/session.md)
* [webContents](api/web-contents.md)
* [web-contents](api/web-contents.md)
* [tray](api/tray.md)
Modules for the renderer process (web page):
### Modules for the Renderer Process (Web Page):
* [ipc (renderer)](api/ipc-renderer.md)
* [remote](api/remote.md)
* [web-frame](api/web-frame.md)
Modules for both processes:
### Modules for Both Processes:
* [clipboard](api/clipboard.md)
* [crash-reporter](api/crash-reporter.md)
@ -60,11 +60,11 @@ Modules for both processes:
## Development
* [Coding style](development/coding-style.md)
* [Source code directory structure](development/source-code-directory-structure.md)
* [Technical differences to NW.js (formerly node-webkit)](development/atom-shell-vs-node-webkit.md)
* [Build system overview](development/build-system-overview.md)
* [Build instructions (Mac)](development/build-instructions-osx.md)
* [Build instructions (Windows)](development/build-instructions-windows.md)
* [Build instructions (Linux)](development/build-instructions-linux.md)
* [Setting up symbol server in debugger](development/setting-up-symbol-server.md)
* [Coding Style](development/coding-style.md)
* [Source Code Directory Structure](development/source-code-directory-structure.md)
* [Technical Differences to NW.js (formerly node-webkit)](development/atom-shell-vs-node-webkit.md)
* [Build System Overview](development/build-system-overview.md)
* [Build Instructions (Mac)](development/build-instructions-osx.md)
* [Build Instructions (Windows)](development/build-instructions-windows.md)
* [Build Instructions (Linux)](development/build-instructions-linux.md)
* [Setting Up Symbol Server in debugger](development/setting-up-symbol-server.md)

View file

@ -152,7 +152,7 @@ Emitted when the gpu process crashes.
The `app` object has the following methods:
**Note** Some methods are only available on specific operating systems and are labeled as such.
**Note:** Some methods are only available on specific operating systems and are labeled as such.
### `app.quit()`

View file

@ -53,7 +53,7 @@ server that you are requesting updates from. A common approach is to use query
parameters, like this:
```javascript
// On the main process
// In the main process
var app = require('app');
var autoUpdater = require('auto-updater');
autoUpdater.setFeedUrl('http://mycompany.com/myapp/latest?version=' + app.getVersion());

View file

@ -117,7 +117,7 @@ Properties `width` and `height` are required.
The `BrowserWindow` object emits the following events:
**Note** Some events are only available on specific operating systems and are labeled as such.
**Note:** Some events are only available on specific operating systems and are labeled as such.
### Event: 'page-title-updated'
@ -224,15 +224,15 @@ Emitted when the window leaves full screen state triggered by html api.
### Event: 'devtools-opened'
Emitted when devtools is opened.
Emitted when DevTools is opened.
### Event: 'devtools-closed'
Emitted when devtools is closed.
Emitted when DevTools is closed.
### Event: 'devtools-focused'
Emitted when devtools is focused / opened.
Emitted when DevTools is focused / opened.
### Event: 'app-command' _Windows_
@ -277,7 +277,7 @@ Find a window according to its ID.
* `path` String
Adds devtools extension located at `path`, and returns extension's name.
Adds DevTools extension located at `path`, and returns extension's name.
The extension will be remembered so you only need to call this API once, this
API is not for programming use.
@ -286,7 +286,7 @@ API is not for programming use.
* `name` String
Remove the devtools extension whose name is `name`.
Remove the DevTools extension whose name is `name`.
## Instance Properties
@ -313,10 +313,11 @@ when the renderer process (web page) has crashed.
### `win.devToolsWebContents`
The `WebContents` of devtools for this window.
Get the `WebContents` of DevTools for this window.
**Note:** Users should never store this object because it may become `null`
when the devtools has been closed.
when the DevTools has been closed.
### `win.id`
@ -326,7 +327,7 @@ The unique ID of this window.
Objects created with `new BrowserWindow` have the following instance methods:
**Note** Some methods are only available on specific operating systems and are labeled as such.
**Note:** Some methods are only available on specific operating systems and are labeled as such.
```javascript
var BrowserWindow = require('browser-window');
@ -589,7 +590,7 @@ Whether the window's document has been edited.
### `win.openDevTools([options])`
* `options` Object (optional). Properties:
* `detach` Boolean - opens devtools in a new window
* `detach` Boolean - opens DevTools in a new window
Opens the developer tools.

View file

@ -4,7 +4,7 @@ The `global-shortcut` module can register/unregister a global keyboard shortcut
with the operating system so that you can customize the operations for various
shortcuts.
**Note**: The shortcut is global; it will work even if the app does
**Note:** The shortcut is global; it will work even if the app does
not have the keyboard focus. You should not use this module until the `ready`
event of the app module is emitted.

View file

@ -4,7 +4,7 @@ The `ipc` module provides a few methods so you can send synchronous and
asynchronous messages from the render process (web page) to the main process.
You can also receive replies from the main process.
**Note**: If you want to make use of modules in the main process from the renderer
**Note:** If you want to make use of modules in the main process from the renderer
process, you might consider using the [remote](remote.md) module.
See [ipc (main process)](ipc-main-process.md) for code examples.
@ -13,7 +13,7 @@ See [ipc (main process)](ipc-main-process.md) for code examples.
The `ipc` module has the following methods for sending messages:
**Note**: When using these methods to send a `message` you must also listen
**Note:** When using these methods to send a `message` you must also listen
for it in the main process with [`ipc (main process)`](ipc-main-process.md).
### `ipc.send(channel[, arg1][, arg2][, ...])`

View file

@ -74,7 +74,7 @@ mixed with other content to create the desired final appearance.
The most common case is to use template images for a menu bar icon so it can
adapt to both light and dark menu bars.
**Note**: Template image is only supported on OS X.
**Note:** Template image is only supported on OS X.
To mark an image as a template image, its filename should end with the word
`Template`. For example:

View file

@ -1,7 +1,7 @@
# power-monitor
The `power-monitor` module is used to monitor power state changes. You can
only use it on the main process. You should not use this module until the `ready`
only use it in the main process. You should not use this module until the `ready`
event of the `app` module is emitted.
For example:

View file

@ -20,7 +20,7 @@ var win = new BrowserWindow({ width: 800, height: 600 });
win.loadUrl('https://github.com');
```
**Note**: for the reverse (access the renderer process from the main process),
**Note:** for the reverse (access the renderer process from the main process),
you can use [webContents.executeJavascript](browser-window.md#webcontents-executejavascript-code).
## Remote Objects

View file

@ -6,7 +6,7 @@ position, etc. You should not use this module until the `ready` event of the
`screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter).
**Note**: In the renderer / DevTools, `window.screen` is a reserved
**Note:** In the renderer / DevTools, `window.screen` is a reserved
DOM property, so writing `var screen = require('screen')` will not work. In our
examples below, we use `atomScreen` as the variable name instead.

View file

@ -5,13 +5,13 @@ Electron and third-party node modules also fully supported as well (including
the [native modules](../tutorial/using-native-node-modules.md)).
Electron also provides some extra built-in modules for developing native
desktop applications. Some modules are only available on the main process, some
desktop applications. Some modules are only available in the main process, some
are only available in the renderer process (web page), and some can be used in
both processes.
The basic rule is: if a module is
[GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) or low-level
system related, then it should be only available on the main process. You need
system related, then it should be only available in the main process. You need
to be familiar with the concept of
[main process vs. renderer process](../tutorial/quick-start.md#the-main-process)
scripts to be able to use those modules.

View file

@ -123,7 +123,7 @@ Emitted when dragged files are dropped in the tray icon.
The `Tray` module has the following methods:
**Note**: Some methods are only available on specific operating systems and are
**Note:** Some methods are only available on specific operating systems and are
labeled as such.
### `Tray.destroy()`

View file

@ -32,6 +32,7 @@ Returns:
* `event` Event
* `errorCode` Integer
* `errorDescription` String
* `validatedUrl` String
This event is like `did-finish-load` but emitted when the load failed or was
cancelled, e.g. `window.stop()` is invoked.
@ -426,13 +427,13 @@ win.webContents.on("did-finish-load", function() {
* `path` String
Adds the specified path to devtools workspace.
Adds the specified path to DevTools workspace.
### `webContents.removeWorkSpace(path)`
* `path` String
Removes the specified path from devtools workspace.
Removes the specified path from DevTools workspace.
### `webContents.send(channel[, args...])`
@ -445,7 +446,7 @@ page can handle it by listening to the `channel` event of the `ipc` module.
An example of sending messages from the main process to the renderer process:
```javascript
// On the main process.
// In the main process.
var window = null;
app.on('ready', function() {
window = new BrowserWindow({width: 800, height: 600});
@ -472,6 +473,6 @@ app.on('ready', function() {
**Note:**
1. The IPC message handler in web pages does not have an `event` parameter,
which is different from the handlers on the main process.
which is different from the handlers in the main process.
2. There is no way to send synchronous messages from the main process to a
renderer process, because it would be very easy to cause dead locks.

View file

@ -153,7 +153,7 @@ value will fail with a DOM exception.
The `webview` tag has the following methods:
**Note**: The webview element must be loaded before using the methods.
**Note:** The webview element must be loaded before using the methods.
**Example**
```javascript
@ -260,15 +260,15 @@ user action, can take advantage of this option for automation.
### `<webview>.openDevTools()`
Opens a devtools window for guest page.
Opens a DevTools window for guest page.
### `<webview>.closeDevTools()`
Closes the devtools window of guest page.
Closes the DevTools window of guest page.
### `<webview>.isDevToolsOpened()`
Returns a boolean whether guest page has a devtools window attached.
Returns a boolean whether guest page has a DevTools window attached.
### `<webview>.inspectElement(x, y)`
@ -279,7 +279,7 @@ Starts inspecting element at position (`x`, `y`) of guest page.
### `<webview>.inspectServiceWorker()`
Opens the devtools for the service worker context present in the guest page.
Opens the DevTools for the service worker context present in the guest page.
### `<webview>.setAudioMuted(muted)`
@ -384,6 +384,7 @@ Returns:
* `errorCode` Integer
* `errorDescription` String
* `validatedUrl` String
This event is like `did-finish-load`, but fired when the load failed or was
cancelled, e.g. `window.stop()` is invoked.

View file

@ -1,7 +1,7 @@
# Electron Documentation Styleguide
Find the appropriate section for your task: [reading Electron documentation](#)
or [writing Electron documentation](#).
Find the appropriate section for your task: [reading Electron documentation](#reading-electron-documentation)
or [writing Electron documentation](#writing-electron-documentation).
## Writing Electron Documentation
@ -25,6 +25,22 @@ These are the ways that we construct the Electron documentation.
- Line length is 80-column wrapped.
- Platform specific methods are noted in italics following method header.
- ```### `method(foo, bar)` _OS X_```
- Prefer 'in the ___ process' over 'on'
### Documentation Translations
Translations of the Electron docs are located within the `docs-translations`
directory.
To add another set (or partial set):
- Create a subdirectory named by language abbreviation.
- Within that subdirectory, duplicate the `docs` directory, keeping the
names of directories and files same.
- Translate the files.
- Update the `README.md` within your language directory to link to the files
you have translated.
- Add a link to your translation directory on the main Electron [README](https://github.com/atom/electron#documentation-translations).
## Reading Electron Documentation

View file

@ -1,6 +1,6 @@
# Debugging the Main Process
The browser window devtools can only debug the renderer process scripts (i.e.
The browser window DevTools can only debug the renderer process scripts (i.e.
the web pages). In order to provide a way to debug the scripts from the main
process, Electron has provided the `--debug` and `--debug-brk` switches.

View file

@ -31,7 +31,7 @@ which handles the manual steps of downloading headers and building native module
npm install --save-dev electron-rebuild
# Every time you run npm install, run this
./node_modules/.bin/electron-rebuild
node ./node_modules/.bin/electron-rebuild
```
### The node-gyp Way

View file

@ -182,15 +182,36 @@ describe 'browser-window module', ->
assert.equal after[0], size.width
assert.equal after[1], size.height
describe '"preload" options', ->
it 'loads the script before other scripts in window', (done) ->
preload = path.join fixtures, 'module', 'set-global.js'
remote.require('ipc').once 'preload', (event, test) ->
assert.equal(test, 'preload')
done()
w.destroy()
w = new BrowserWindow(show: false, width: 400, height: 400, preload: preload)
w.loadUrl 'file://' + path.join(fixtures, 'api', 'preload.html')
describe '"web-preferences" option', ->
afterEach ->
remote.require('ipc').removeAllListeners('answer')
describe '"preload" option', ->
it 'loads the script before other scripts in window', (done) ->
preload = path.join fixtures, 'module', 'set-global.js'
remote.require('ipc').once 'answer', (event, test) ->
assert.equal(test, 'preload')
done()
w.destroy()
w = new BrowserWindow
show: false
'web-preferences':
preload: preload
w.loadUrl 'file://' + path.join(fixtures, 'api', 'preload.html')
describe '"node-integration" option', ->
it 'disables node integration when specified to false', (done) ->
preload = path.join fixtures, 'module', 'send-later.js'
remote.require('ipc').once 'answer', (event, test) ->
assert.equal(test, 'undefined')
done()
w.destroy()
w = new BrowserWindow
show: false
'web-preferences':
preload: preload
'node-integration': false
w.loadUrl 'file://' + path.join(fixtures, 'api', 'blank.html')
describe 'beforeunload handler', ->
it 'returning true would not prevent close', (done) ->

5
spec/fixtures/api/blank.html vendored Normal file
View file

@ -0,0 +1,5 @@
<html>
<script type="text/javascript" charset="utf-8">
window;
</script>
</html>

View file

@ -3,7 +3,7 @@
<script type="text/javascript" charset="utf-8">
if (!window.test)
window.test = 'window'
require('ipc').send('preload', window.test);
require('ipc').send('answer', window.test);
</script>
</body>
</html>

4
spec/fixtures/module/send-later.js vendored Normal file
View file

@ -0,0 +1,4 @@
var ipc = require('ipc');
window.onload = function() {
ipc.send('answer', typeof window.process);
}

View file

@ -2,7 +2,6 @@ var app = require('app');
var ipc = require('ipc');
var dialog = require('dialog');
var BrowserWindow = require('browser-window');
var Menu = require('menu');
var window = null;
process.port = 0; // will be used by crash-reporter spec.
@ -52,93 +51,6 @@ app.on('window-all-closed', function() {
});
app.on('ready', function() {
var template = [
{
label: 'Atom',
submenu: [
{
label: 'Quit',
accelerator: 'CommandOrControl+Q',
click: function(item, window) { app.quit(); }
},
],
},
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'CommandOrControl+Z',
selector: 'undo:',
},
{
label: 'Redo',
accelerator: 'CommandOrControl+Shift+Z',
selector: 'redo:',
},
{
type: 'separator',
},
{
label: 'Cut',
accelerator: 'CommandOrControl+X',
selector: 'cut:',
},
{
label: 'Copy',
accelerator: 'CommandOrControl+C',
selector: 'copy:',
},
{
label: 'Paste',
accelerator: 'CommandOrControl+V',
selector: 'paste:',
},
{
label: 'Select All',
accelerator: 'CommandOrControl+A',
selector: 'selectAll:',
},
]
},
{
label: 'View',
submenu: [
{
label: 'Reload',
accelerator: 'CommandOrControl+R',
click: function(item, window) { window.restart(); }
},
{
label: 'Enter Fullscreen',
click: function(item, window) { window.setFullScreen(true); }
},
{
label: 'Toggle DevTools',
accelerator: 'Alt+CommandOrControl+I',
click: function(item, window) { window.toggleDevTools(); }
},
]
},
{
label: 'Window',
submenu: [
{
label: 'Open',
accelerator: 'CommandOrControl+O',
},
{
label: 'Close',
accelerator: 'CommandOrControl+W',
click: function(item, window) { window.close(); }
},
]
},
];
var menu = Menu.buildFromTemplate(template);
app.setApplicationMenu(menu);
// Test if using protocol module would crash.
require('protocol').registerStringProtocol('test-if-crashes', function() {});

2
vendor/native_mate vendored

@ -1 +1 @@
Subproject commit 8ca005eb41591f583ebab804945311903f866ad6
Subproject commit b7387da0854b20d376fdae0d93a01f83d080668d