From 1a1b45e088e02c3e35402dc07d112d03b17dceb8 Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Fri, 4 Sep 2015 19:01:31 -0300 Subject: [PATCH 01/36] application-distribution.md translated to pt-BR --- docs-translations/pt-BR/README-pt-BR.md | 2 +- .../application-distribution-pt-BR.md | 118 ++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 docs-translations/pt-BR/tutorial/application-distribution-pt-BR.md diff --git a/docs-translations/pt-BR/README-pt-BR.md b/docs-translations/pt-BR/README-pt-BR.md index 111ab06a39bb..1fe9ab14b60e 100644 --- a/docs-translations/pt-BR/README-pt-BR.md +++ b/docs-translations/pt-BR/README-pt-BR.md @@ -1,6 +1,6 @@ ## Guias -* [Distribuir Aplicação](../../docs/tutorial/application-distribution.md) +* [Distribuir Aplicação](tutorial/application-distribution-pt-BR.md) * [Empacotamento da aplicação](../../docs/tutorial/application-packaging.md) * [Usando módulos nativos](../../docs/tutorial/using-native-node-modules.md) * [Depuração do processo principal](../../docs/tutorial/debugging-main-process.md) diff --git a/docs-translations/pt-BR/tutorial/application-distribution-pt-BR.md b/docs-translations/pt-BR/tutorial/application-distribution-pt-BR.md new file mode 100644 index 000000000000..41f2457c408b --- /dev/null +++ b/docs-translations/pt-BR/tutorial/application-distribution-pt-BR.md @@ -0,0 +1,118 @@ +# Distribuição de aplicações + +Para distribuir sua aplicação com o Electron, você deve nomear o diretório que contém sua aplicação como +`app` e dentro deste diretório colocar os recursos que você está utilizando (no OSX +`Electron.app/Contents/Resources/`, +no Linux e no Windows é em `resources/`): + +No OSX: + +```text +electron/Electron.app/Contents/Resources/app/ +├── package.json +├── main.js +└── index.html +``` + +No Windows e Linux: + +```text +electron/resources/app +├── package.json +├── main.js +└── index.html +``` + +Logo após execute `Electron.app` (ou `electron` no Linux e `electron.exe` no Windows), +e o Electron iniciaria a aplicação. O diretório `electron` será utilizado para criar a distribuição para +usuários finais. + +## Empacotando sua aplicação em um arquivo. + +Além de copiar todos os seus arquivos fontes para a distribuição, você também pode +empacotar seu aplicativo em um arquivo [asar](https://github.com/atom/asar) para evitar +de expor seu código fonte aos usuários finais. + +Para usar um arquivo `asar` ao invés da pasta `app` você precisa mudar o nome do +arquivo para `app.asar` e colocá-lo sob o diretório de recursos do Electron como +mostrado abaixo, então o Electron vai ler o arquivo e iniciar a aplicação a partir dele. + +No OSX: + +```text +electron/Electron.app/Contents/Resources/ +└── app.asar +``` + +No Windows e Linux: + +```text +electron/resources/ +└── app.asar +``` + +Mais detalhes podem ser encontrados em [Empacotamento da aplicação](../../../docs/tutorial/application-packaging.md). + +## Renomeando a marca Electron na sua distribuição + +Depois de empacotar seu aplicativo Electron, você vai querer renomear a marca Electron +antes de distribuí-lo aos usuários. + +### Janelas + +Você pode renomear `electron.exe` para o nome que desejar e editar o seu ícone e outras +informações com ferramentas como [rcedit](https://github.com/atom/rcedit) ou +[ResEdit](http://www.resedit.net). + +### OS X + +Você pode renomear `Electron.app` para o nome que desejar e também pode mudar o nome +do `CFBundleDisplayName`, `CFBundleIdentifier` e os campos em `CFBundleName` +nos seguinte arquivos: + +* `Electron.app/Contents/Info.plist` +* `Electron.app/Contents/frameworks/Electron Helper.app/Contents/Info.plist` + +Você também pode renomear o arquivo de ajuda para evitar a exibição de `Electron Helper` no +Monitor de Atividades, mas certifique-se de também renomear o arquivo de ajuda no executável do +aplicativo. + +A estrutura de uma aplicação renomada seria assim: + +``` +MyApp.app/Contents +├── Info.plist +├── MacOS/ +│   └── MyApp +└── Frameworks/ + ├── MyApp Helper EH.app + | ├── Info.plist + | └── MacOS/ + |    └── MyApp Helper EH + ├── MyApp Helper NP.app + | ├── Info.plist + | └── MacOS/ + |    └── MyApp Helper NP + └── MyApp Helper.app + ├── Info.plist + └── MacOS/ +    └── MyApp Helper +``` + +### Linux + +Você pode renomear o executável `electron` para o nome que desejar. + +## Renomeando a marca Electron do código fonte. + +Também é possível fazer renomear a marca Electron do código fonte, alterando o nome do produto e +reconstruí-lo a partir da fonte, para fazer isso você precisa modificar o arquivo `atom.gyp`. + +### grunt-build-atom-shell + +A modificação do código fonte do Electron para ganhar a sua marca pode ser muito complexa, por isso, +uma tarefa para o Grunt foi criado e irá cuidar desta tarefa automaticamente para você: +[grunt-build-atom-shell](https://github.com/paulcbetts/grunt-build-atom-shell). + +Esta tarefa irá automaticamente editar o arquivo `.gyp`, compilar o código +e reconstruir os módulos nativos da aplicação para utilizar o novo nome. \ No newline at end of file From dcbd8316dfd4ff465b044f51c77a4ba4d7c7f0f3 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Sat, 5 Sep 2015 01:06:52 +0300 Subject: [PATCH 02/36] Remove chrome_version.h from git chrome_version.h is dynamically generated by bootstrap.py so it shouldn't be in git --- atom/common/chrome_version.h | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 atom/common/chrome_version.h diff --git a/atom/common/chrome_version.h b/atom/common/chrome_version.h deleted file mode 100644 index 250051683786..000000000000 --- a/atom/common/chrome_version.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2014 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -// This file is generated by script/bootstrap.py, you should never modify it -// by hand. - -#ifndef ATOM_COMMON_CHROME_VERSION_H_ -#define ATOM_COMMON_CHROME_VERSION_H_ - -#define CHROME_VERSION_STRING "45.0.2454.85" -#define CHROME_VERSION "v" CHROME_VERSION_STRING - -#endif // ATOM_COMMON_CHROME_VERSION_H_ From 41e1555cf4cd223024a38bbe70b2b71a395f102d Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Sat, 5 Sep 2015 01:11:37 +0300 Subject: [PATCH 03/36] Add chrome_version.h to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0c6f4cb79dd0..dc7a879cc8aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +/atom/common/chrome_version.h /build/ /dist/ /external_binaries/ From a8d56df41e908bfc4420863492f36cee935d30a6 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Sat, 5 Sep 2015 01:29:12 +0300 Subject: [PATCH 04/36] Drop "-es" from file names When "README.md" is named "README-es.md", github doesn't show it's preview automatically. So I removed "-es" from all the docs. --- docs-translations/es/{README-es.md => README.md} | 14 +++++++------- ...tribution-es.md => application-distribution.md} | 0 ...on-packaging-es.md => application-packaging.md} | 0 ...ain-process-es.md => debugging-main-process.md} | 0 ...on-es.md => desktop-environment-integration.md} | 0 ...tools-extension-es.md => devtools-extension.md} | 0 ...fline-events-es.md => online-offline-events.md} | 0 .../tutorial/{quick-start-es.md => quick-start.md} | 0 ...-modules-es.md => using-native-node-modules.md} | 0 ...h-plugin-es.md => using-pepper-flash-plugin.md} | 0 ...river-es.md => using-selenium-and-webdriver.md} | 0 11 files changed, 7 insertions(+), 7 deletions(-) rename docs-translations/es/{README-es.md => README.md} (94%) rename docs-translations/es/tutorial/{application-distribution-es.md => application-distribution.md} (100%) rename docs-translations/es/tutorial/{application-packaging-es.md => application-packaging.md} (100%) rename docs-translations/es/tutorial/{debugging-main-process-es.md => debugging-main-process.md} (100%) rename docs-translations/es/tutorial/{desktop-environment-integration-es.md => desktop-environment-integration.md} (100%) rename docs-translations/es/tutorial/{devtools-extension-es.md => devtools-extension.md} (100%) rename docs-translations/es/tutorial/{online-offline-events-es.md => online-offline-events.md} (100%) rename docs-translations/es/tutorial/{quick-start-es.md => quick-start.md} (100%) rename docs-translations/es/tutorial/{using-native-node-modules-es.md => using-native-node-modules.md} (100%) rename docs-translations/es/tutorial/{using-pepper-flash-plugin-es.md => using-pepper-flash-plugin.md} (100%) rename docs-translations/es/tutorial/{using-selenium-and-webdriver-es.md => using-selenium-and-webdriver.md} (100%) diff --git a/docs-translations/es/README-es.md b/docs-translations/es/README.md similarity index 94% rename from docs-translations/es/README-es.md rename to docs-translations/es/README.md index 617e66ec6f5b..d95ad4ee8b8a 100644 --- a/docs-translations/es/README-es.md +++ b/docs-translations/es/README.md @@ -1,12 +1,12 @@ ## Guías -* [Distribución de aplicaciones](tutorial/application-distribution-es.md) -* [Empaquetamiento de aplicaciones](tutorial/application-packaging-es.md) -* [Utilizando módulos nativos](tutorial/using-native-node-modules-es.md) -* [Depurando el proceso principal](tutorial/debugging-main-process-es.md) -* [Utilizando Selenium y WebDriver](tutorial/using-selenium-and-webdriver-es.md) -* [Extensión DevTools](tutorial/devtools-extension-es.md) -* [Utilizando el plugin pepper flash](tutorial/using-pepper-flash-plugin-es.md) +* [Distribución de aplicaciones](tutorial/application-distribution.md) +* [Empaquetamiento de aplicaciones](tutorial/application-packaging.md) +* [Utilizando módulos nativos](tutorial/using-native-node-modules.md) +* [Depurando el proceso principal](tutorial/debugging-main-process.md) +* [Utilizando Selenium y WebDriver](tutorial/using-selenium-and-webdriver.md) +* [Extensión DevTools](tutorial/devtools-extension.md) +* [Utilizando el plugin pepper flash](tutorial/using-pepper-flash-plugin.md) ## Tutoriales diff --git a/docs-translations/es/tutorial/application-distribution-es.md b/docs-translations/es/tutorial/application-distribution.md similarity index 100% rename from docs-translations/es/tutorial/application-distribution-es.md rename to docs-translations/es/tutorial/application-distribution.md diff --git a/docs-translations/es/tutorial/application-packaging-es.md b/docs-translations/es/tutorial/application-packaging.md similarity index 100% rename from docs-translations/es/tutorial/application-packaging-es.md rename to docs-translations/es/tutorial/application-packaging.md diff --git a/docs-translations/es/tutorial/debugging-main-process-es.md b/docs-translations/es/tutorial/debugging-main-process.md similarity index 100% rename from docs-translations/es/tutorial/debugging-main-process-es.md rename to docs-translations/es/tutorial/debugging-main-process.md diff --git a/docs-translations/es/tutorial/desktop-environment-integration-es.md b/docs-translations/es/tutorial/desktop-environment-integration.md similarity index 100% rename from docs-translations/es/tutorial/desktop-environment-integration-es.md rename to docs-translations/es/tutorial/desktop-environment-integration.md diff --git a/docs-translations/es/tutorial/devtools-extension-es.md b/docs-translations/es/tutorial/devtools-extension.md similarity index 100% rename from docs-translations/es/tutorial/devtools-extension-es.md rename to docs-translations/es/tutorial/devtools-extension.md diff --git a/docs-translations/es/tutorial/online-offline-events-es.md b/docs-translations/es/tutorial/online-offline-events.md similarity index 100% rename from docs-translations/es/tutorial/online-offline-events-es.md rename to docs-translations/es/tutorial/online-offline-events.md diff --git a/docs-translations/es/tutorial/quick-start-es.md b/docs-translations/es/tutorial/quick-start.md similarity index 100% rename from docs-translations/es/tutorial/quick-start-es.md rename to docs-translations/es/tutorial/quick-start.md diff --git a/docs-translations/es/tutorial/using-native-node-modules-es.md b/docs-translations/es/tutorial/using-native-node-modules.md similarity index 100% rename from docs-translations/es/tutorial/using-native-node-modules-es.md rename to docs-translations/es/tutorial/using-native-node-modules.md diff --git a/docs-translations/es/tutorial/using-pepper-flash-plugin-es.md b/docs-translations/es/tutorial/using-pepper-flash-plugin.md similarity index 100% rename from docs-translations/es/tutorial/using-pepper-flash-plugin-es.md rename to docs-translations/es/tutorial/using-pepper-flash-plugin.md diff --git a/docs-translations/es/tutorial/using-selenium-and-webdriver-es.md b/docs-translations/es/tutorial/using-selenium-and-webdriver.md similarity index 100% rename from docs-translations/es/tutorial/using-selenium-and-webdriver-es.md rename to docs-translations/es/tutorial/using-selenium-and-webdriver.md From 0bc8e7b7876c0c21148be3db68a5f9b1f69a4aa3 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Sat, 5 Sep 2015 01:40:26 +0300 Subject: [PATCH 05/36] Update README.md Most of the links in the page were invalid because those docs aren't translated yet, so I changed them to point to the originals written in English. IMO that's a better experience than receiving 404. --- docs-translations/es/README.md | 76 +++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/docs-translations/es/README.md b/docs-translations/es/README.md index d95ad4ee8b8a..497cc4e05ccf 100644 --- a/docs-translations/es/README.md +++ b/docs-translations/es/README.md @@ -10,59 +10,59 @@ ## Tutoriales -* [Introducción](tutorial/quick-start.md) -* [Integración con el entorno de escritorio](tutorial/desktop-environment-integration.md) -* [Detección del evento en línea/fuera de línea](tutorial/online-offline-events.md) +* [Introducción](../../docs/tutorial/quick-start.md) +* [Integración con el entorno de escritorio](../../docs/tutorial/desktop-environment-integration.md) +* [Detección del evento en línea/fuera de línea](../../docs/tutorial/online-offline-events.md) ## API -* [Sinopsis](api/synopsis.md) -* [Proceso](api/process.md) -* [Parámetros CLI soportados (Chrome)](api/chrome-command-line-switches.md) +* [Sinopsis](../../docs/api/synopsis.md) +* [Proceso](../../docs/api/process.md) +* [Parámetros CLI soportados (Chrome)](../../docs/api/chrome-command-line-switches.md) Elementos DOM customizados: -* [Objeto `File`](api/file-object.md) -* [Etiqueta ``](api/web-view-tag.md) -* [Función `window.open`](api/window-open.md) +* [Objeto `File`](../../docs/api/file-object.md) +* [Etiqueta ``](../../docs/api/web-view-tag.md) +* [Función `window.open`](../../docs/api/window-open.md) Módulos del proceso principal: -* [app](api/app.md) -* [auto-updater](api/auto-updater.md) -* [browser-window](api/browser-window.md) -* [content-tracing](api/content-tracing.md) -* [dialog](api/dialog.md) -* [global-shortcut](api/global-shortcut.md) -* [ipc (main process)](api/ipc-main-process.md) -* [menu](api/menu.md) -* [menu-item](api/menu-item.md) -* [power-monitor](api/power-monitor.md) -* [power-save-blocker](api/power-save-blocker.md) -* [protocol](api/protocol.md) -* [tray](api/tray.md) +* [app](../../docs/api/app.md) +* [auto-updater](../../docs/api/auto-updater.md) +* [browser-window](../../docs/api/browser-window.md) +* [content-tracing](../../docs/api/content-tracing.md) +* [dialog](../../docs/api/dialog.md) +* [global-shortcut](../../docs/api/global-shortcut.md) +* [ipc (main process)](../../docs/api/ipc-main-process.md) +* [menu](../../docs/api/menu.md) +* [menu-item](../../docs/api/menu-item.md) +* [power-monitor](../../docs/api/power-monitor.md) +* [power-save-blocker](../../docs/api/power-save-blocker.md) +* [protocol](../../docs/api/protocol.md) +* [tray](../../docs/api/tray.md) Módulos del renderer (página web): -* [ipc (renderer)](api/ipc-renderer.md) -* [remote](api/remote.md) -* [web-frame](api/web-frame.md) +* [ipc (renderer)](../../docs/api/ipc-renderer.md) +* [remote](../../docs/api/remote.md) +* [web-frame](../../docs/api/web-frame.md) Módulos de ambos procesos: -* [clipboard](api/clipboard.md) -* [crash-reporter](api/crash-reporter.md) -* [native-image](api/native-image.md) -* [screen](api/screen.md) -* [shell](api/shell.md) +* [clipboard](../../docs/api/clipboard.md) +* [crash-reporter](../../docs/api/crash-reporter.md) +* [native-image](../../docs/api/native-image.md) +* [screen](../../docs/api/screen.md) +* [shell](../../docs/api/shell.md) ## Desarrollo -* [Guía de estilo](development/coding-style.md) -* [Estructura de directorio](development/source-code-directory-structure.md) -* [Diferencias técnicas con NW.js (anteriormente conocido como node-webkit)](development/atom-shell-vs-node-webkit.md) -* [Sistema de compilación](development/build-system-overview.md) -* [Instrucciones de compilación (Mac)](development/build-instructions-osx.md) -* [Instrucciones de compilación (Windows)](development/build-instructions-windows.md) -* [Instrucciones de compilación (Linux)](development/build-instructions-linux.md) -* [Configurando un servidor de símbolos en el depurador](development/setting-up-symbol-server.md) +* [Guía de estilo](../../docs/development/coding-style.md) +* [Estructura de directorio](../../docs/development/source-code-directory-structure.md) +* [Diferencias técnicas con NW.js (anteriormente conocido como node-webkit)](../../docs/development/atom-shell-vs-node-webkit.md) +* [Sistema de compilación](../../docs/development/build-system-overview.md) +* [Instrucciones de compilación (Mac)](../../docs/development/build-instructions-osx.md) +* [Instrucciones de compilación (Windows)](../../docs/development/build-instructions-windows.md) +* [Instrucciones de compilación (Linux)](../../docs/development/build-instructions-linux.md) +* [Configurando un servidor de símbolos en el depurador](../../docs/development/setting-up-symbol-server.md) From 943fe2c22d32620e2a82dfb7ef73f60b676bbe60 Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Sat, 5 Sep 2015 23:32:51 -0300 Subject: [PATCH 06/36] Change file names to follow styleguide --- docs-translations/pt-BR/{README-pt-BR.md => README.md} | 2 +- docs-translations/pt-BR/{styleguide-pt-BR.md => styleguide.md} | 0 ...cation-distribution-pt-BR.md => application-distribution.md} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename docs-translations/pt-BR/{README-pt-BR.md => README.md} (97%) rename docs-translations/pt-BR/{styleguide-pt-BR.md => styleguide.md} (100%) rename docs-translations/pt-BR/tutorial/{application-distribution-pt-BR.md => application-distribution.md} (100%) diff --git a/docs-translations/pt-BR/README-pt-BR.md b/docs-translations/pt-BR/README.md similarity index 97% rename from docs-translations/pt-BR/README-pt-BR.md rename to docs-translations/pt-BR/README.md index 1fe9ab14b60e..08834fc39c9f 100644 --- a/docs-translations/pt-BR/README-pt-BR.md +++ b/docs-translations/pt-BR/README.md @@ -1,6 +1,6 @@ ## Guias -* [Distribuir Aplicação](tutorial/application-distribution-pt-BR.md) +* [Distribuir Aplicação](tutorial/application-distribution.md) * [Empacotamento da aplicação](../../docs/tutorial/application-packaging.md) * [Usando módulos nativos](../../docs/tutorial/using-native-node-modules.md) * [Depuração do processo principal](../../docs/tutorial/debugging-main-process.md) diff --git a/docs-translations/pt-BR/styleguide-pt-BR.md b/docs-translations/pt-BR/styleguide.md similarity index 100% rename from docs-translations/pt-BR/styleguide-pt-BR.md rename to docs-translations/pt-BR/styleguide.md diff --git a/docs-translations/pt-BR/tutorial/application-distribution-pt-BR.md b/docs-translations/pt-BR/tutorial/application-distribution.md similarity index 100% rename from docs-translations/pt-BR/tutorial/application-distribution-pt-BR.md rename to docs-translations/pt-BR/tutorial/application-distribution.md From f56d71510409b40b36e0b7ad881838f4791833ff Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Sun, 6 Sep 2015 01:27:34 -0300 Subject: [PATCH 07/36] Translated application-packaging.md to pt-BR. --- docs-translations/pt-BR/README.md | 2 +- .../pt-BR/tutorial/application-packaging.md | 158 ++++++++++++++++++ 2 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 docs-translations/pt-BR/tutorial/application-packaging.md diff --git a/docs-translations/pt-BR/README.md b/docs-translations/pt-BR/README.md index 08834fc39c9f..88fb26a5ea54 100644 --- a/docs-translations/pt-BR/README.md +++ b/docs-translations/pt-BR/README.md @@ -1,7 +1,7 @@ ## Guias * [Distribuir Aplicação](tutorial/application-distribution.md) -* [Empacotamento da aplicação](../../docs/tutorial/application-packaging.md) +* [Empacotamento da aplicação](tutorial/application-packaging.md) * [Usando módulos nativos](../../docs/tutorial/using-native-node-modules.md) * [Depuração do processo principal](../../docs/tutorial/debugging-main-process.md) * [Usando Selenium e WebDriver](../../docs/tutorial/using-selenium-and-webdriver.md) diff --git a/docs-translations/pt-BR/tutorial/application-packaging.md b/docs-translations/pt-BR/tutorial/application-packaging.md new file mode 100644 index 000000000000..f55cbb2f7d64 --- /dev/null +++ b/docs-translations/pt-BR/tutorial/application-packaging.md @@ -0,0 +1,158 @@ +# Empacotamento da aplicação + +Para proteger os recursos e o código fonte da sua aplicação você pode optar por +empacotar a sua aplicação em um arquivo [asar](https://github.com/atom/asar), isto é possível com poucas +alterações em seu código. + +## Gerando um arquivo `asar` + +Um arquivo [asar][asar] é um formato parecido com tar ou zip bem simples que concatena arquivos +em um único arquivo. O Electron pode ler arquivos arbitrários a partir dele sem descompacatar +o arquivo inteiro. + +Passos para empacotar a sua aplicação em um arquivo `asar`: + +### 1. Instale o utilitário asar + +```bash +$ npm install -g asar +``` + +### 2. Empacote a sua aplicação + +```bash +$ asar pack your-app app.asar +``` + +## Usando arquivos `asar` + +No Electron existem dois conjuntos de APIs: Node APIs fornecidas pelo Node.js e Web +APIs fornecidas pelo Chromium. Ambas as APIs suportam a leitura de arquivos `asar`. + +### Node API + +As API's do Node como `fs.readFile` e `require` tratam os pacotes `asar` +como diretórios virtuais e os arquivos dentro dele como arquivos normais. + +Por exemplo, temos um arquivo `example.asar` sob `/path/to`: + +```bash +$ asar list /path/to/example.asar +/app.js +/file.txt +/dir/module.js +/static/index.html +/static/main.css +/static/jquery.min.js +``` + +Lendo um arquivo em pacote `asar`: + +```javascript +var fs = require('fs'); +fs.readFileSync('/path/to/example.asar/file.txt'); +``` + +Listando todos os arquivos a partir da raiz: + +```javascript +var fs = require('fs'); +fs.readdirSync('/path/to/example.asar'); +``` + +Utilizando um módulo dentro do pacote `asar`: + +```javascript +require('/path/to/example.asar/dir/module.js'); +``` + +Você também pode renderizar uma página web apartir de um arquivo `asar` utilizando o módulo `BrowserWindow`: + +```javascript +var BrowserWindow = require('browser-window'); +var win = new BrowserWindow({width: 800, height: 600}); +win.loadUrl('file:///path/to/example.asar/static/index.html'); +``` + +### API Web + +Em uma página web, arquivos em um pacote `asar` pode ser solicitado com o protocolo `file:`. +Como a API Node, arquivos `asar` são tratadas como diretórios. + +Por exemplo, para obter um arquivo com `$ .get`: + +```html + +``` + +### Tratando um pacote `asar` como um arquivo normal + +Para alguns casos, precisamos verificar o checksum de um pacote `asar`, para fazer isto, precisamos ler +o arquivo `asar` como um arquivo normal. Para isto, você pode usar o built-in +`original-fs` que fornece a API `fs`, sem apoio a arquivos asar`: + +```javascript +var originalFs = require('original-fs'); +originalFs.readFileSync('/path/to/example.asar'); +``` + +## Limitaçõs na API Node + +Mesmo fazendo grandes esforços para pacotes `asar` ser tratado no Node como diretórios, +ainda existem limitações devido a natureza de baixo nível do Node + +### Arquivos `asar` são somente leitura + +Os arquivos `asar` não podem ser modificados. + +### Diretório de trabalho não pode ser comportar como diretório de arquivos + +Embora pacotes `asar` são tratadas como diretórios, não há +diretórios reais no sistema de arquivos, assim você nunca pode definir o diretório de trabalho para +diretórios em pacotes `asar`, passando-os como a opção `cwd` de algumas APIs +também irá causar erros. + +### Descompactação extra em algumas APIs + +A maioria das APIs `fs` pode ler um arquivo ou obter informações de um arquivo a partir de pacotes `asar` +sem descompacta-lo, mas para algumas APIs da rota real o Electron irá extrair o arquivo necessário para um +arquivo temporário e passar o caminho do arquivo temporário para as APIs, +isso adiciona um pouco de sobrecarga para essas APIs. + +APIs que requer descompactação extras são: + +* `child_process.execFile` +* `fs.open` +* `fs.openSync` +* `process.dlopen` - Usado por `require` em módulos nativos + +### Falsas informações de status do módulo `fs.stat` + +O objeto `Stats` retornado por` fs.stat` e outras funções relacionadas não são informações confiáveis, +você não deve confiar no objeto `Stats` exceto para obter o +tamanho do arquivo e verificação de tipo de arquivo. + +## Adicionando arquivos em um pacote `asar` + +Como dito acima, algumas APIs deo Node irá descompactar o arquivo para quando o filesystem +requsistar, além dos problemas de desempenho, ele também pode levar a falsos alertas +de vírus. + +Para contornar isso, você pode descompactar alguns arquivos usando a +opção `--unpack`, um exemplo de exclusão de bibliotecas compartilhadas de módulos nativos +é: + +```bash +$ asar pack app app.asar --unpack *.node +``` + +Depois de executar o comando, além do `app.asar`, há também +`app.asar.unpacked` pasta gerada que contém os arquivos descompactados, você +deve copiá-lo juntamente com `app.asar` quando enviá-lo para os usuários. + +Mais informações no repositório [asar](https://github.com/atom/asar) \ No newline at end of file From 24bbe5dabf36b3a7a3937821d91db6caa9ebad60 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 15:55:08 +0800 Subject: [PATCH 08/36] No need to define WebContentsPreferences::From --- atom/browser/api/atom_api_web_view_manager.cc | 4 +++- atom/browser/web_contents_preferences.cc | 18 +++++------------- atom/browser/web_contents_preferences.h | 3 --- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/atom/browser/api/atom_api_web_view_manager.cc b/atom/browser/api/atom_api_web_view_manager.cc index 83287ac8b2f1..e57c5ffb6bb4 100644 --- a/atom/browser/api/atom_api_web_view_manager.cc +++ b/atom/browser/api/atom_api_web_view_manager.cc @@ -10,6 +10,8 @@ #include "content/public/browser/browser_context.h" #include "native_mate/dictionary.h" +using atom::WebContentsPreferences; + namespace mate { template<> @@ -48,7 +50,7 @@ void AddGuest(int guest_instance_id, manager->AddGuest(guest_instance_id, element_instance_id, embedder, guest_web_contents); - atom::WebContentsPreferences::From(guest_web_contents)->Merge(options); + WebContentsPreferences::FromWebContents(guest_web_contents)->Merge(options); } void RemoveGuest(content::WebContents* embedder, int guest_instance_id) { diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 19ea826a5ff7..db55eddf7e2d 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -16,13 +16,12 @@ #include "ui/gfx/switches.h" #endif +DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::WebContentsPreferences); + namespace atom { namespace { -// Pointer as WebContents's user data key. -const char* kWebPreferencesKey = "WebContentsPreferences"; - // Array of available web runtime features. const char* kWebRuntimeFeatures[] = { switches::kExperimentalFeatures, @@ -40,7 +39,7 @@ WebContentsPreferences::WebContentsPreferences( content::WebContents* web_contents, base::DictionaryValue* web_preferences) { web_preferences_.Swap(web_preferences); - web_contents->SetUserData(kWebPreferencesKey, this); + web_contents->SetUserData(UserDataKey(), this); } WebContentsPreferences::~WebContentsPreferences() { @@ -50,17 +49,10 @@ void WebContentsPreferences::Merge(const base::DictionaryValue& extend) { web_preferences_.MergeDictionary(&extend); } -// static -WebContentsPreferences* WebContentsPreferences::From( - content::WebContents* web_contents) { - return static_cast( - web_contents->GetUserData(kWebPreferencesKey)); -} - // static void WebContentsPreferences::AppendExtraCommandLineSwitches( content::WebContents* web_contents, base::CommandLine* command_line) { - WebContentsPreferences* self = From(web_contents); + WebContentsPreferences* self = FromWebContents(web_contents); if (!self) return; @@ -130,7 +122,7 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches( // static void WebContentsPreferences::OverrideWebkitPrefs( content::WebContents* web_contents, content::WebPreferences* prefs) { - WebContentsPreferences* self = From(web_contents); + WebContentsPreferences* self = FromWebContents(web_contents); if (!self) return; diff --git a/atom/browser/web_contents_preferences.h b/atom/browser/web_contents_preferences.h index 310456725aaf..83b485f449bc 100644 --- a/atom/browser/web_contents_preferences.h +++ b/atom/browser/web_contents_preferences.h @@ -22,9 +22,6 @@ namespace atom { class WebContentsPreferences : public content::WebContentsUserData { public: - // Get the preferences of |web_contents|. - static WebContentsPreferences* From(content::WebContents* web_contents); - // Append command paramters according to |web_contents|'s preferences. static void AppendExtraCommandLineSwitches( content::WebContents* web_contents, base::CommandLine* command_line); From 46b2b91a27846ee619997c60d8d313d829b48314 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 16:12:31 +0800 Subject: [PATCH 09/36] Don't use Node's internal APIs --- atom/browser/api/atom_api_power_monitor.cc | 7 +++---- atom/browser/api/atom_api_screen.cc | 8 +++++--- atom/browser/api/atom_api_tray.cc | 3 ++- atom/browser/api/atom_api_web_contents.cc | 10 ++++++---- atom/browser/api/atom_api_web_contents.h | 4 ++-- atom/browser/api/atom_api_window.cc | 4 ++-- atom/renderer/api/atom_api_renderer_ipc.cc | 8 ++++---- vendor/node | 2 +- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/atom/browser/api/atom_api_power_monitor.cc b/atom/browser/api/atom_api_power_monitor.cc index 093df2a1d4ef..31b35e10cea8 100644 --- a/atom/browser/api/atom_api_power_monitor.cc +++ b/atom/browser/api/atom_api_power_monitor.cc @@ -5,12 +5,11 @@ #include "atom/browser/api/atom_api_power_monitor.h" #include "atom/browser/browser.h" +#include "atom/common/node_includes.h" #include "base/power_monitor/power_monitor.h" #include "base/power_monitor/power_monitor_device_source.h" #include "native_mate/dictionary.h" -#include "atom/common/node_includes.h" - namespace atom { namespace api { @@ -41,9 +40,9 @@ void PowerMonitor::OnResume() { // static v8::Local PowerMonitor::Create(v8::Isolate* isolate) { if (!Browser::Get()->is_ready()) { - node::ThrowError( + isolate->ThrowException(v8::Exception::Error(mate::StringToV8( isolate, - "Cannot initialize \"power-monitor\" module before app is ready"); + "Cannot initialize \"power-monitor\" module before app is ready"))); return v8::Null(isolate); } diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index 9f81cf6eeff7..b73bda9ced84 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -113,14 +113,16 @@ mate::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder( // static v8::Local Screen::Create(v8::Isolate* isolate) { if (!Browser::Get()->is_ready()) { - node::ThrowError(isolate, - "Cannot initialize \"screen\" module before app is ready"); + isolate->ThrowException(v8::Exception::Error(mate::StringToV8( + isolate, + "Cannot initialize \"screen\" module before app is ready"))); return v8::Null(isolate); } gfx::Screen* screen = gfx::Screen::GetNativeScreen(); if (!screen) { - node::ThrowError(isolate, "Failed to get screen information"); + isolate->ThrowException(v8::Exception::Error(mate::StringToV8( + isolate, "Failed to get screen information"))); return v8::Null(isolate); } diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index 1382f015a63b..90bcbcf3e2a7 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -35,7 +35,8 @@ Tray::~Tray() { // static mate::Wrappable* Tray::New(v8::Isolate* isolate, const gfx::Image& image) { if (!Browser::Get()->is_ready()) { - node::ThrowError(isolate, "Cannot create Tray before app is ready"); + isolate->ThrowException(v8::Exception::Error(mate::StringToV8( + isolate, "Cannot create Tray before app is ready"))); return nullptr; } return new Tray(image); diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index d22f7aab61fd..9cb52a1ec74d 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -717,17 +717,19 @@ void WebContents::PrintToPDF(const base::DictionaryValue& setting, PrintToPDF(setting, callback); } -void WebContents::AddWorkSpace(const base::FilePath& path) { +void WebContents::AddWorkSpace(mate::Arguments* args, + const base::FilePath& path) { if (path.empty()) { - node::ThrowError(isolate(), "path cannot be empty"); + args->ThrowError("path cannot be empty"); return; } DevToolsAddFileSystem(path); } -void WebContents::RemoveWorkSpace(const base::FilePath& path) { +void WebContents::RemoveWorkSpace(mate::Arguments* args, + const base::FilePath& path) { if (path.empty()) { - node::ThrowError(isolate(), "path cannot be empty"); + args->ThrowError("path cannot be empty"); return; } DevToolsRemoveFileSystem(path); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index e2e405b73853..3c6bde9c24aa 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -87,8 +87,8 @@ class WebContents : public mate::TrackableObject, const PrintToPDFCallback& callback); // DevTools workspace api. - void AddWorkSpace(const base::FilePath& path); - void RemoveWorkSpace(const base::FilePath& path); + void AddWorkSpace(mate::Arguments* args, const base::FilePath& path); + void RemoveWorkSpace(mate::Arguments* args, const base::FilePath& path); // Editing commands. void Undo(); diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index e171fa7698f0..4acd101f3c98 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -209,8 +209,8 @@ void Window::OnExecuteWindowsCommand(const std::string& command_name) { mate::Wrappable* Window::New(v8::Isolate* isolate, const mate::Dictionary& options) { if (!Browser::Get()->is_ready()) { - node::ThrowError(isolate, - "Cannot create BrowserWindow before app is ready"); + isolate->ThrowException(v8::Exception::Error(mate::StringToV8( + isolate, "Cannot create BrowserWindow before app is ready"))); return nullptr; } return new Window(isolate, options); diff --git a/atom/renderer/api/atom_api_renderer_ipc.cc b/atom/renderer/api/atom_api_renderer_ipc.cc index d222f8f73b85..bd0b62656c1d 100644 --- a/atom/renderer/api/atom_api_renderer_ipc.cc +++ b/atom/renderer/api/atom_api_renderer_ipc.cc @@ -30,7 +30,7 @@ RenderView* GetCurrentRenderView() { return RenderView::FromWebView(view); } -void Send(v8::Isolate* isolate, +void Send(mate::Arguments* args, const base::string16& channel, const base::ListValue& arguments) { RenderView* render_view = GetCurrentRenderView(); @@ -41,10 +41,10 @@ void Send(v8::Isolate* isolate, render_view->GetRoutingID(), channel, arguments)); if (!success) - node::ThrowError(isolate, "Unable to send AtomViewHostMsg_Message"); + args->ThrowError("Unable to send AtomViewHostMsg_Message"); } -base::string16 SendSync(v8::Isolate* isolate, +base::string16 SendSync(mate::Arguments* args, const base::string16& channel, const base::ListValue& arguments) { base::string16 json; @@ -60,7 +60,7 @@ base::string16 SendSync(v8::Isolate* isolate, bool success = render_view->Send(message); if (!success) - node::ThrowError(isolate, "Unable to send AtomViewHostMsg_Message_Sync"); + args->ThrowError("Unable to send AtomViewHostMsg_Message_Sync"); return json; } diff --git a/vendor/node b/vendor/node index 5a8258dfabe7..c8962e460f3b 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 5a8258dfabe7ce3e1489b13d3459ef1d6260d6a5 +Subproject commit c8962e460f3bf03d405489a8380a5571730f5f8d From e365cb6b1c78fb0f9c78ff4f4c20766cca7bcf7a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 16:29:54 +0800 Subject: [PATCH 10/36] No longer needs to define node_includes.h at last --- atom/browser/api/atom_api_app.cc | 3 +-- atom/browser/api/atom_api_auto_updater.cc | 3 +-- atom/browser/api/atom_api_content_tracing.cc | 3 +-- atom/browser/api/atom_api_cookies.cc | 2 -- atom/browser/api/atom_api_power_save_blocker.cc | 2 +- atom/browser/api/atom_api_protocol.cc | 3 +-- atom/browser/api/atom_api_session.cc | 3 +-- atom/browser/api/atom_api_tray.cc | 3 +-- atom/browser/atom_browser_main_parts.cc | 3 +-- atom/common/api/atom_api_asar.cc | 3 +-- atom/common/api/atom_api_shell.cc | 3 +-- atom/common/api/atom_api_v8_util.cc | 3 +-- atom/common/api/event_emitter_caller.cc | 3 +-- atom/common/node_bindings.cc | 3 +-- atom/common/node_includes.h | 2 ++ atom/renderer/api/atom_api_renderer_ipc.cc | 3 +-- atom/renderer/atom_render_view_observer.cc | 3 +-- 17 files changed, 17 insertions(+), 31 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index c25b3be5f4d6..e2d265c5da39 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -19,6 +19,7 @@ #include "atom/browser/api/atom_api_web_contents.h" #include "atom/common/native_mate_converters/callback.h" #include "atom/common/native_mate_converters/file_path_converter.h" +#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/environment.h" #include "base/files/file_path.h" @@ -34,8 +35,6 @@ #include "base/strings/utf_string_conversions.h" #endif -#include "atom/common/node_includes.h" - using atom::Browser; namespace mate { diff --git a/atom/browser/api/atom_api_auto_updater.cc b/atom/browser/api/atom_api_auto_updater.cc index 1691ac103e96..250aa3e45f64 100644 --- a/atom/browser/api/atom_api_auto_updater.cc +++ b/atom/browser/api/atom_api_auto_updater.cc @@ -7,11 +7,10 @@ #include "base/time/time.h" #include "atom/browser/auto_updater.h" #include "atom/browser/browser.h" +#include "atom/common/node_includes.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" -#include "atom/common/node_includes.h" - namespace atom { namespace api { diff --git a/atom/browser/api/atom_api_content_tracing.cc b/atom/browser/api/atom_api_content_tracing.cc index e4bf33c7b5c5..f29946d1f462 100644 --- a/atom/browser/api/atom_api_content_tracing.cc +++ b/atom/browser/api/atom_api_content_tracing.cc @@ -7,13 +7,12 @@ #include "atom/common/native_mate_converters/callback.h" #include "atom/common/native_mate_converters/file_path_converter.h" +#include "atom/common/node_includes.h" #include "base/bind.h" #include "base/files/file_util.h" #include "content/public/browser/tracing_controller.h" #include "native_mate/dictionary.h" -#include "atom/common/node_includes.h" - using content::TracingController; namespace mate { diff --git a/atom/browser/api/atom_api_cookies.cc b/atom/browser/api/atom_api_cookies.cc index bf56a8dc13bd..4f989eff7275 100644 --- a/atom/browser/api/atom_api_cookies.cc +++ b/atom/browser/api/atom_api_cookies.cc @@ -20,8 +20,6 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" -#include "atom/common/node_includes.h" - using atom::api::Cookies; using content::BrowserThread; diff --git a/atom/browser/api/atom_api_power_save_blocker.cc b/atom/browser/api/atom_api_power_save_blocker.cc index c75901cb1e31..58983e6c846a 100644 --- a/atom/browser/api/atom_api_power_save_blocker.cc +++ b/atom/browser/api/atom_api_power_save_blocker.cc @@ -6,9 +6,9 @@ #include +#include "atom/common/node_includes.h" #include "content/public/browser/power_save_blocker.h" #include "native_mate/dictionary.h" -#include "atom/common/node_includes.h" namespace mate { diff --git a/atom/browser/api/atom_api_protocol.cc b/atom/browser/api/atom_api_protocol.cc index f77f3229ed0a..661ab1b5cbdd 100644 --- a/atom/browser/api/atom_api_protocol.cc +++ b/atom/browser/api/atom_api_protocol.cc @@ -12,9 +12,8 @@ #include "atom/browser/net/url_request_fetch_job.h" #include "atom/browser/net/url_request_string_job.h" #include "atom/common/native_mate_converters/callback.h" -#include "native_mate/dictionary.h" - #include "atom/common/node_includes.h" +#include "native_mate/dictionary.h" using content::BrowserThread; diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 7d31626c1413..f07ab8b78045 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -13,6 +13,7 @@ #include "atom/common/native_mate_converters/callback.h" #include "atom/common/native_mate_converters/gurl_converter.h" #include "atom/common/native_mate_converters/file_path_converter.h" +#include "atom/common/node_includes.h" #include "base/files/file_path.h" #include "base/prefs/pref_service.h" #include "base/strings/string_util.h" @@ -29,8 +30,6 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" -#include "atom/common/node_includes.h" - using content::BrowserThread; using content::StoragePartition; diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index 90bcbcf3e2a7..0f5829e19c14 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -12,13 +12,12 @@ #include "atom/common/native_mate_converters/gfx_converter.h" #include "atom/common/native_mate_converters/image_converter.h" #include "atom/common/native_mate_converters/string16_converter.h" +#include "atom/common/node_includes.h" #include "native_mate/constructor.h" #include "native_mate/dictionary.h" #include "ui/events/event_constants.h" #include "ui/gfx/image/image.h" -#include "atom/common/node_includes.h" - namespace atom { namespace api { diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index 31a490464143..61b98dfc40ec 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -13,6 +13,7 @@ #include "atom/browser/node_debugger.h" #include "atom/common/api/atom_bindings.h" #include "atom/common/node_bindings.h" +#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/browser_process.h" @@ -22,8 +23,6 @@ #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" #endif -#include "atom/common/node_includes.h" - namespace atom { // static diff --git a/atom/common/api/atom_api_asar.cc b/atom/common/api/atom_api_asar.cc index 24e9ce9b0668..4ea7d8c5c362 100644 --- a/atom/common/api/atom_api_asar.cc +++ b/atom/common/api/atom_api_asar.cc @@ -10,13 +10,12 @@ #include "atom/common/asar/archive.h" #include "atom/common/native_mate_converters/callback.h" #include "atom/common/native_mate_converters/file_path_converter.h" +#include "atom/common/node_includes.h" #include "native_mate/arguments.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" #include "native_mate/wrappable.h" -#include "atom/common/node_includes.h" - namespace { class Archive : public mate::Wrappable { diff --git a/atom/common/api/atom_api_shell.cc b/atom/common/api/atom_api_shell.cc index 013c5f5c6c84..a4599ee0c359 100644 --- a/atom/common/api/atom_api_shell.cc +++ b/atom/common/api/atom_api_shell.cc @@ -7,9 +7,8 @@ #include "atom/common/platform_util.h" #include "atom/common/native_mate_converters/file_path_converter.h" #include "atom/common/native_mate_converters/gurl_converter.h" -#include "native_mate/dictionary.h" - #include "atom/common/node_includes.h" +#include "native_mate/dictionary.h" namespace { diff --git a/atom/common/api/atom_api_v8_util.cc b/atom/common/api/atom_api_v8_util.cc index 21f23a97b456..bba3399a8dbd 100644 --- a/atom/common/api/atom_api_v8_util.cc +++ b/atom/common/api/atom_api_v8_util.cc @@ -3,11 +3,10 @@ // found in the LICENSE file. #include "atom/common/api/object_life_monitor.h" +#include "atom/common/node_includes.h" #include "native_mate/dictionary.h" #include "v8/include/v8-profiler.h" -#include "atom/common/node_includes.h" - namespace { v8::Local CreateObjectWithName(v8::Isolate* isolate, diff --git a/atom/common/api/event_emitter_caller.cc b/atom/common/api/event_emitter_caller.cc index 6b0a07ad414a..94eb9ce9e79a 100644 --- a/atom/common/api/event_emitter_caller.cc +++ b/atom/common/api/event_emitter_caller.cc @@ -5,11 +5,10 @@ #include "atom/common/api/event_emitter_caller.h" #include "atom/common/api/locker.h" +#include "atom/common/node_includes.h" #include "base/memory/scoped_ptr.h" #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" -#include "atom/common/node_includes.h" - namespace mate { namespace internal { diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 09666a470b6c..5aec200550ad 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -11,6 +11,7 @@ #include "atom/common/api/locker.h" #include "atom/common/atom_command_line.h" #include "atom/common/native_mate_converters/file_path_converter.h" +#include "atom/common/node_includes.h" #include "base/command_line.h" #include "base/base_paths.h" #include "base/files/file_path.h" @@ -21,8 +22,6 @@ #include "native_mate/dictionary.h" #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" -#include "atom/common/node_includes.h" - using content::BrowserThread; // Force all builtin modules to be referenced so they can actually run their diff --git a/atom/common/node_includes.h b/atom/common/node_includes.h index 0c4189b2fac3..3876d8622913 100644 --- a/atom/common/node_includes.h +++ b/atom/common/node_includes.h @@ -5,6 +5,8 @@ #ifndef ATOM_COMMON_NODE_INCLUDES_H_ #define ATOM_COMMON_NODE_INCLUDES_H_ +#include "base/logging.h" + // Include common headers for using node APIs. #define BUILDING_NODE_EXTENSION diff --git a/atom/renderer/api/atom_api_renderer_ipc.cc b/atom/renderer/api/atom_api_renderer_ipc.cc index bd0b62656c1d..061293e80d03 100644 --- a/atom/renderer/api/atom_api_renderer_ipc.cc +++ b/atom/renderer/api/atom_api_renderer_ipc.cc @@ -5,13 +5,12 @@ #include "atom/common/api/api_messages.h" #include "atom/common/native_mate_converters/string16_converter.h" #include "atom/common/native_mate_converters/value_converter.h" +#include "atom/common/node_includes.h" #include "content/public/renderer/render_view.h" #include "native_mate/dictionary.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebView.h" -#include "atom/common/node_includes.h" - using content::RenderView; using blink::WebLocalFrame; using blink::WebView; diff --git a/atom/renderer/atom_render_view_observer.cc b/atom/renderer/atom_render_view_observer.cc index 1f199ea445c6..456ca5ba4b24 100644 --- a/atom/renderer/atom_render_view_observer.cc +++ b/atom/renderer/atom_render_view_observer.cc @@ -13,6 +13,7 @@ #include "atom/common/api/api_messages.h" #include "atom/common/api/event_emitter_caller.h" #include "atom/common/native_mate_converters/value_converter.h" +#include "atom/common/node_includes.h" #include "atom/common/options_switches.h" #include "atom/renderer/atom_renderer_client.h" #include "base/command_line.h" @@ -31,8 +32,6 @@ #include "third_party/WebKit/public/web/WebView.h" #include "ui/base/resource/resource_bundle.h" -#include "atom/common/node_includes.h" - namespace atom { namespace { From 13722e26cd7e9c44380299b063fb7ad5bdb3081b Mon Sep 17 00:00:00 2001 From: John-Lin Date: Mon, 7 Sep 2015 17:36:14 +0800 Subject: [PATCH 11/36] add doc translation for power-monitor.md --- docs-translations/zh-TW/api/power-monitor.md | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs-translations/zh-TW/api/power-monitor.md diff --git a/docs-translations/zh-TW/api/power-monitor.md b/docs-translations/zh-TW/api/power-monitor.md new file mode 100644 index 000000000000..e38dee3212da --- /dev/null +++ b/docs-translations/zh-TW/api/power-monitor.md @@ -0,0 +1,36 @@ +# power-monitor + +`power-monitor` 模組用來監看電源狀態的改變。你只能在主行程 (main process) 裡面使用。 +你應該要等到 `ready` 在 `app` 模組裡的事件被觸發 (emit),再使用這個模組。 + +舉例來說: + +```javascript +var app = require('app'); + +app.on('ready', function() { + require('power-monitor').on('suspend', function() { + console.log('The system is going to sleep'); + }); +}); +``` + +## 事件 (Events) + +`power-monitor` 模組會觸發 (emits) 以下幾個事件: + +### 事件: 'suspend' + +當系統進入 睡眠 (suspend) 時觸發。 + +### 事件: 'resume' + +當系統 resume 時觸發。 + +### 事件: 'on-ac' + +當系統改變使用交流電源 (AC) 時觸發。 + +### 事件: 'on-battery' + +當系統改變使用電池店員時觸發。 From 66f7f2e6f28c566edb86ea84c1be46deef78cffa Mon Sep 17 00:00:00 2001 From: John-Lin Date: Mon, 7 Sep 2015 17:36:33 +0800 Subject: [PATCH 12/36] add doc translation for power-save-blocker.md --- .../zh-TW/api/power-save-blocker.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docs-translations/zh-TW/api/power-save-blocker.md diff --git a/docs-translations/zh-TW/api/power-save-blocker.md b/docs-translations/zh-TW/api/power-save-blocker.md new file mode 100644 index 000000000000..a652751c0bb8 --- /dev/null +++ b/docs-translations/zh-TW/api/power-save-blocker.md @@ -0,0 +1,47 @@ +# powerSaveBlocker + +`power-save-blocker` 模組是用來防止系統進入省電模式 low-power (sleep) mode +因此讓應用程式可以保持系統和螢幕的活躍 (active)。 + +舉例來說: + +```javascript +var powerSaveBlocker = require('power-save-blocker'); + +var id = powerSaveBlocker.start('prevent-display-sleep'); +console.log(powerSaveBlocker.isStarted(id)); + +powerSaveBlocker.stop(id); +``` + +## 方法 (Methods) + +`power-save-blocker` 模組有以下幾個方法: + +### `powerSaveBlocker.start(type)` + +* `type` String - Power save blocker type. + * `prevent-app-suspension` - 防止一個應用程式進入睡眠 (suspended)。 將保持系統活躍, + 但允許螢幕被關閉。 使用案例:下載一個檔案或是播放音樂。 + * `prevent-display-sleep`- 防止螢幕進入睡眠。將保持系統和螢幕的活躍。 + 使用案例:播放影片 + +當防止系統進入省電模式 low-power (sleep) mode 。 會回傳一個識別的整數來代表 power save blocker + +**注意:** `prevent-display-sleep` 比 `prevent-app-suspension` 擁有較高的優先權。 +只有高的優先全力才會有效,換句話說 `prevent-display-sleep` 總是會優先於 `prevent-app-suspension` + +例如,一個 API 呼叫 A 請求去做 `prevent-app-suspension`,而另外一個 B 請求去做 `prevent-display-sleep` + `prevent-display-sleep` 將會被使用,直到 B 停止他的請求,`prevent-app-suspension` 才會被使用。 + +### `powerSaveBlocker.stop(id)` + +* `id` Integer - power save blocker 會回傳 id 透過 `powerSaveBlocker.start`. + +將指定的 id 停止 power save blocker + +### `powerSaveBlocker.isStarted(id)` + +* `id` Integer - power save blocker 會回傳 id 透過 `powerSaveBlocker.start`. + +不管對應的 `powerSaveBlocker` 是否已經啟動,將會回傳一個布林值 (boolean) From d7ec0b99fdf37463599109dea7c78a01fe775125 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 21:07:27 +0800 Subject: [PATCH 13/36] spec: process.stdout should not throw exception --- spec/node-spec.coffee | 4 ++++ spec/static/main.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index 5ec2bb05e906..164480603e0f 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -133,3 +133,7 @@ describe 'node feature', -> b = new Buffer(p.innerText) assert.equal b.toString(), 'Jøhänñéß' assert.equal Buffer.byteLength(p.innerText), 13 + + describe 'process.stdout', -> + it 'should not throw exception', -> + process.stdout diff --git a/spec/static/main.js b/spec/static/main.js index d8b53167c5e2..1f6f9325e490 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -10,6 +10,11 @@ process.port = 0; // will be used by crash-reporter spec. app.commandLine.appendSwitch('js-flags', '--expose_gc'); app.commandLine.appendSwitch('ignore-certificate-errors'); +// Accessing stdout in the main process will result in the process.stdout +// throwing UnknownSystemError in renderer process sometimes. This line makes +// sure we can reproduce it in renderer process. +process.stdout; + ipc.on('message', function(event, arg) { event.sender.send('message', arg); }); From 8912b404a9399c8fc7d8eccdf64aef1a3f5e6ea3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 21:34:15 +0800 Subject: [PATCH 14/36] spec: process.stdout should have isTTY defined --- spec/node-spec.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index 164480603e0f..d7c3b068f4b6 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -137,3 +137,6 @@ describe 'node feature', -> describe 'process.stdout', -> it 'should not throw exception', -> process.stdout + + it 'should have isTTY defined', -> + assert.equal typeof(process.stdout.isTTY), 'boolean' From d4aa2308cd91fa822e6c3ee6900df76c6ad81c0b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 21:34:27 +0800 Subject: [PATCH 15/36] Update node to catch exception when accessing process.stdout --- vendor/node | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/node b/vendor/node index c8962e460f3b..9da7dd871c31 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit c8962e460f3bf03d405489a8380a5571730f5f8d +Subproject commit 9da7dd871c313d318bc1447a83ba3c7618bbbc18 From 4412a89270ce0b7582c410e61a9d69fd8f3b65c5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 21:44:03 +0800 Subject: [PATCH 16/36] Explicitly writes debug log to stderr If we don't do this Chromium will close stdout and stderr for us, resulting process.stdout not working. --- atom/app/atom_main_delegate.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc index 02dd11c81ba0..3c7d6b2e7034 100644 --- a/atom/app/atom_main_delegate.cc +++ b/atom/app/atom_main_delegate.cc @@ -38,7 +38,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { #else settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; #endif // defined(DEBUG) -#endif // defined(OS_WIN) +#else // defined(OS_WIN) + settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; +#endif // !defined(OS_WIN) logging::InitLogging(settings); // Logging with pid and timestamp. From 62b1034c6be9a0590d3cea8978927e67650b0a08 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 22:42:46 +0800 Subject: [PATCH 17/36] Suppress the isTTY spec, not reliable on some machines --- spec/node-spec.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index d7c3b068f4b6..94174c38b743 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -138,5 +138,6 @@ describe 'node feature', -> it 'should not throw exception', -> process.stdout - it 'should have isTTY defined', -> + # Not reliable on some machines + xit 'should have isTTY defined', -> assert.equal typeof(process.stdout.isTTY), 'boolean' From ad6e67fdfa8bb5443420d27cf42d80ec317b3e81 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Mon, 7 Sep 2015 19:51:28 +0300 Subject: [PATCH 18/36] Revert "Add chrome_version.h to gitignore" This reverts commit 41e1555cf4cd223024a38bbe70b2b71a395f102d. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index dc7a879cc8aa..0c6f4cb79dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .DS_Store -/atom/common/chrome_version.h /build/ /dist/ /external_binaries/ From b521e45ef886bd04adf2860898a8a0f1e5784a55 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Mon, 7 Sep 2015 19:51:37 +0300 Subject: [PATCH 19/36] Revert "Remove chrome_version.h from git" This reverts commit dcbd8316dfd4ff465b044f51c77a4ba4d7c7f0f3. --- atom/common/chrome_version.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 atom/common/chrome_version.h diff --git a/atom/common/chrome_version.h b/atom/common/chrome_version.h new file mode 100644 index 000000000000..250051683786 --- /dev/null +++ b/atom/common/chrome_version.h @@ -0,0 +1,14 @@ +// Copyright (c) 2014 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +// This file is generated by script/bootstrap.py, you should never modify it +// by hand. + +#ifndef ATOM_COMMON_CHROME_VERSION_H_ +#define ATOM_COMMON_CHROME_VERSION_H_ + +#define CHROME_VERSION_STRING "45.0.2454.85" +#define CHROME_VERSION "v" CHROME_VERSION_STRING + +#endif // ATOM_COMMON_CHROME_VERSION_H_ From db3e27ceaab98dd7602f8f619eda8ca7df8a3571 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Mon, 7 Sep 2015 21:55:02 +0300 Subject: [PATCH 20/36] Fix `create_chrome_version_h` in bootstrap.py The code was supposed to compare the content of the existing file with the new content and only replace the file if the content was different, but it had a fatal flow. It opened the existing file with 'w+' or 'wb+' and they both truncate the file, so the compare was always false and we always overwrote the file. The updated code compares the file content ignoring line endings and writes the file only if its different or if it didn't exist. --- script/bootstrap.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index 293d3dc2dd10..d5ad41a61c59 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -162,13 +162,16 @@ def create_chrome_version_h(): version = f.read() with open(template_file, 'r') as f: template = f.read() - if sys.platform in ['win32', 'cygwin']: - open_mode = 'wb+' - else: - open_mode = 'w+' - with open(target_file, open_mode) as f: - content = template.replace('{PLACEHOLDER}', version.strip()) - if f.read() != content: + content = template.replace('{PLACEHOLDER}', version.strip()) + + # We update the file only if the content has changed (ignoring line ending + # differences). + should_write = True + if os.path.isfile(target_file): + with open(target_file, 'r') as f: + should_write = f.read().replace('r', '') != content.replace('r', '') + if should_write: + with open(target_file, 'w') as f: f.write(content) From 1e0facc103b25a26dcdec294e5b0c87dae37389e Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Tue, 8 Sep 2015 08:42:28 +0900 Subject: [PATCH 21/36] Update as upstream --- docs-translations/ko/api/web-view-tag.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs-translations/ko/api/web-view-tag.md b/docs-translations/ko/api/web-view-tag.md index e292e972dcd2..b4af6d3ea87f 100644 --- a/docs-translations/ko/api/web-view-tag.md +++ b/docs-translations/ko/api/web-view-tag.md @@ -125,14 +125,14 @@ ``` -`webview`에서 사용하는 스토리지 파티션을 지정합니다. -스토리지 파티션 ID를 `persist:`로 시작하도록 지정하면 앱의 모든 `webview`에서 지정한 스토리지 파티션 ID를 사용하도록 할 수 있습니다. -만약 `persist:` 접두사가 없을 경우 `webview`는 인 메모리 스토리지 파티션을 사용합니다. -여러 `webview`에서 같은 파티션 ID를 사용하면 같은 스토리지 파티션을 공유합니다. -만약 스토리지 파티션 ID가 지정되지 않으면 앱의 기본 스토리지를 사용합니다. +페이지에서 사용하는 세션을 설정합니다. +만약 `partition` 속성이 `persist:` 접두사를 시작하면 같은 `partition` 속성을 가진 앱 내 모든 페이지가 공유하는 영구 세션을 사용합니다. +`persist:` 접두사가 없을 경우 페이지는 인 메모리 세션을 사용합니다. +동일한 `partition`을 지정하여 다중 페이지에서 동일한 세션을 공유할 수 있도록 할 수 있습니다. +만약 `partition`이 지정되지 않으면 앱의 기본 세션을 사용합니다. 이 값은 첫 탐색 이전에만 지정할 수 있습니다. -즉. 작동중인 랜더러 프로세스의 스토리지 파티션은 변경할 수 없습니다. +즉. 작동중인 랜더러 프로세스의 세션은 변경할 수 없습니다. 이후 이 값을 바꾸려고 시도하면 DOM 예외를 발생시킵니다. ## Methods From 21bd5789352be761a47702045431698ee4b1edd9 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Tue, 8 Sep 2015 08:50:59 +0900 Subject: [PATCH 22/36] Update README-ko.md --- README-ko.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README-ko.md b/README-ko.md index 29ac5a0951f0..9ce6748fc871 100644 --- a/README-ko.md +++ b/README-ko.md @@ -13,6 +13,8 @@ Electron 프레임워크는 JavaScript, HTML 그리고 CSS를 사용하여 Cross Electron에 대한 중요한 알림을 받고 싶다면 Twitter에서 [@ElectronJS](https://twitter.com/electronjs)를 팔로우 하세요. +이 프로젝트는 기여자 규약 1.2를 준수합니다. 이 프로젝트에 참여할 때 코드를 유지해야 합니다. 받아들일 수 없는 행동은 atom@github.com로 보고 하십시오. + ## 다운로드 Linux, Windows, Mac용으로 미리 빌드된 Electron 바이너리와 디버그 심볼이 준비되어 있습니다. [releases](https://github.com/atom/electron/releases) 페이지에서 받아 볼 수 있습니다. From 785eb9657b32c08f4f4ddd5a33cb006854ff4285 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 8 Sep 2015 05:24:07 +0530 Subject: [PATCH 23/36] remove unused code --- atom/browser/web_view_constants.cc | 24 ---------------------- atom/browser/web_view_constants.h | 27 ------------------------- atom/browser/web_view_guest_delegate.cc | 10 +++++++-- filenames.gypi | 2 -- 4 files changed, 8 insertions(+), 55 deletions(-) delete mode 100644 atom/browser/web_view_constants.cc delete mode 100644 atom/browser/web_view_constants.h diff --git a/atom/browser/web_view_constants.cc b/atom/browser/web_view_constants.cc deleted file mode 100644 index 6f8314cbcf36..000000000000 --- a/atom/browser/web_view_constants.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2015 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#include "atom/browser/web_view_constants.h" - -namespace atom { - -namespace web_view { - -const char kPreloadUrl[] = "preloadUrl"; -const char kNodeIntegration[] = "nodeIntegration"; -const char kPlugins[] = "plugins"; -const char kDisableWebSecurity[] = "disableWebSecurity"; -const char kPartitionId[] = "partitionId"; - -const int kDefaultWidth = 300; -const int kDefaultHeight = 300; - -const char kWebViewInfoKeyName[] = "web_view_info"; - -} // namespace web_view - -} // namespace atom diff --git a/atom/browser/web_view_constants.h b/atom/browser/web_view_constants.h deleted file mode 100644 index 0831bdbdf1d4..000000000000 --- a/atom/browser/web_view_constants.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2015 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#ifndef ATOM_BROWSER_WEB_VIEW_CONSTANTS_H_ -#define ATOM_BROWSER_WEB_VIEW_CONSTANTS_H_ - -namespace atom { - -namespace web_view { - -extern const char kPreloadUrl[]; -extern const char kNodeIntegration[]; -extern const char kPlugins[]; -extern const char kDisableWebSecurity[]; -extern const char kPartitionId[]; - -extern const int kDefaultWidth; -extern const int kDefaultHeight; - -extern const char kWebViewInfoKeyName[]; - -} // namespace web_view - -} // namespace atom - -#endif // ATOM_BROWSER_WEB_VIEW_CONSTANTS_H_ diff --git a/atom/browser/web_view_guest_delegate.cc b/atom/browser/web_view_guest_delegate.cc index a954cea8dc02..8e1810c4a39b 100644 --- a/atom/browser/web_view_guest_delegate.cc +++ b/atom/browser/web_view_guest_delegate.cc @@ -5,7 +5,6 @@ #include "atom/browser/web_view_guest_delegate.h" #include "atom/browser/api/atom_api_web_contents.h" -#include "atom/browser/web_view_constants.h" #include "atom/common/native_mate_converters/gurl_converter.h" #include "content/public/browser/guest_host.h" #include "content/public/browser/render_frame_host.h" @@ -14,6 +13,13 @@ namespace atom { +namespace { + +const int kDefaultWidth = 300; +const int kDefaultHeight = 300; + +} // namespace + WebViewGuestDelegate::WebViewGuestDelegate() : guest_opaque_(true), guest_host_(nullptr), @@ -172,7 +178,7 @@ gfx::Size WebViewGuestDelegate::GetDefaultSize() const { return embedder_web_contents_->GetRenderWidgetHostView() ->GetVisibleViewportSize(); } else { - return gfx::Size(web_view::kDefaultWidth, web_view::kDefaultHeight); + return gfx::Size(kDefaultWidth, kDefaultHeight); } } diff --git a/filenames.gypi b/filenames.gypi index 78a8e17f2f99..461c812753c9 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -230,8 +230,6 @@ 'atom/browser/web_contents_preferences.h', 'atom/browser/web_dialog_helper.cc', 'atom/browser/web_dialog_helper.h', - 'atom/browser/web_view_constants.cc', - 'atom/browser/web_view_constants.h', 'atom/browser/web_view_guest_delegate.cc', 'atom/browser/web_view_guest_delegate.h', 'atom/browser/web_view_manager.cc', From e5386cf8eaa05d29113df42ac7d0885aac140ca4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 8 Sep 2015 13:40:10 +0800 Subject: [PATCH 24/36] Bump v0.32.0 --- atom.gyp | 2 +- atom/browser/resources/mac/Info.plist | 2 +- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/atom.gyp b/atom.gyp index c0fc40187984..547bc3c38af5 100644 --- a/atom.gyp +++ b/atom.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '0.31.2', + 'version%': '0.32.0', }, 'includes': [ 'filenames.gypi', diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 73facdc7f565..884cdcd1a1ea 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,7 +17,7 @@ CFBundleIconFile atom.icns CFBundleVersion - 0.31.2 + 0.32.0 LSMinimumSystemVersion 10.8.0 NSMainNibFile diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 7e7fea9f2fb3..16c7f0311f89 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,31,2,0 - PRODUCTVERSION 0,31,2,0 + FILEVERSION 0,32,0,0 + PRODUCTVERSION 0,32,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "0.31.2" + VALUE "FileVersion", "0.32.0" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "0.31.2" + VALUE "ProductVersion", "0.32.0" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a0b865b0e2a6..e270498e40bf 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -6,8 +6,8 @@ #define ATOM_VERSION_H #define ATOM_MAJOR_VERSION 0 -#define ATOM_MINOR_VERSION 31 -#define ATOM_PATCH_VERSION 2 +#define ATOM_MINOR_VERSION 32 +#define ATOM_PATCH_VERSION 0 #define ATOM_VERSION_IS_RELEASE 1 From 8e1979a6a503a440029449508d19f7f21b067330 Mon Sep 17 00:00:00 2001 From: John-Lin Date: Tue, 8 Sep 2015 15:46:48 +0800 Subject: [PATCH 25/36] add doc translation for file object --- docs-translations/zh-TW/api/file-object.md | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs-translations/zh-TW/api/file-object.md diff --git a/docs-translations/zh-TW/api/file-object.md b/docs-translations/zh-TW/api/file-object.md new file mode 100644 index 000000000000..4f523c489516 --- /dev/null +++ b/docs-translations/zh-TW/api/file-object.md @@ -0,0 +1,28 @@ +# `File` object + +DOM's File 介面提供一個將本地文件抽象化,並可以讓使用者對本地文件直接使用 HTML5 檔案 API +Electron 可以添加一個 `path` 屬性至 `File` 接口進而顯示檔案在檔案系統內的真實路徑。 + +範例,獲得一個檔案之真實路徑,將檔案拖拉至應用程式 (dragged-onto-the-app): + +```html +
+ Drag your file here +
+ + +``` From ba02e19fae3d413754e3eb9bce4255314a8eda42 Mon Sep 17 00:00:00 2001 From: John-Lin Date: Tue, 8 Sep 2015 15:47:11 +0800 Subject: [PATCH 26/36] add doc translation for process --- docs-translations/zh-TW/api/process.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs-translations/zh-TW/api/process.md diff --git a/docs-translations/zh-TW/api/process.md b/docs-translations/zh-TW/api/process.md new file mode 100644 index 000000000000..a4f45352b9c4 --- /dev/null +++ b/docs-translations/zh-TW/api/process.md @@ -0,0 +1,23 @@ +# process + +在 Electron 裡的 `process` 物件具有以下幾個與 upstream node 的不同點: + +* `process.type` String - Process 的型態,可以是 `browser` (i.e. 主行程) 或 `renderer`. +* `process.versions['electron']` String - Electron 的版本 +* `process.versions['chrome']` String - Chromium 的版本 +* `process.resourcesPath` String - JavaScript 源碼的路徑 + +# 方法 (Methods) + +`process` 物件具有以下的方法: + +### `process.hang` + +會導致目前行程的主執行緒停住 + +## process.setFdLimit(maxDescriptors) _OS X_ _Linux_ + +* `maxDescriptors` Integer + +設置文件描述符 (file descriptor) soft limit `maxDescriptors` 或 OS hard +limit ,以較低者為準當目前的行程。 From a2007189447e908088e0488d67c3eecbd5fe736b Mon Sep 17 00:00:00 2001 From: John-Lin Date: Tue, 8 Sep 2015 15:47:29 +0800 Subject: [PATCH 27/36] add doc translation for synopsis --- docs-translations/zh-TW/api/synopsis.md | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs-translations/zh-TW/api/synopsis.md diff --git a/docs-translations/zh-TW/api/synopsis.md b/docs-translations/zh-TW/api/synopsis.md new file mode 100644 index 000000000000..484f5e353847 --- /dev/null +++ b/docs-translations/zh-TW/api/synopsis.md @@ -0,0 +1,41 @@ +# Synopsis + +所有的 [Node.js's 內建模組](http://nodejs.org/api/) 都可以在 Electron 使用,而且 +第三方的 node 模組同樣的全部支援(包含[原生模組](../tutorial/using-native-node-modules.md)) + +Electron 也提供一些額外的內建模組用來開發原生桌面應用程式,一些模組只可以使用在主行程上 +(main process) 一些只可以使用在渲染行程 (renderer process) 上 (網頁) ,另外還有一些 +模組在兩邊的行程都可以使用。 + +基本的規則是: 如果一個模組是 [GUI](https://zh.wikipedia.org/wiki/%E5%9B%BE%E5%BD%A2%E7%94%A8%E6%88%B7%E7%95%8C%E9%9D%A2) +或者是 low-level 與系統相關的,那麼它就應該只能在主行程上使用 (main process) 你必須要對熟悉 [main process vs. renderer process](../tutorial/quick-start.md#the-main-process) 的觀念,才能去使用這些模組。 + +主行程 (main process) 腳本是一個像一般 Node.js 的腳本: + +```javascript +var app = require('app'); +var BrowserWindow = require('browser-window'); + +var window = null; + +app.on('ready', function() { + window = new BrowserWindow({width: 800, height: 600}); + window.loadUrl('https://github.com'); +}); +``` + +渲染行程 (renderer process) 跟一般正常的網頁沒有差別,而且還能有使用 node 模組的能力: + +```html + + + + + + +``` + +執行你的應用程式,請閱讀[Run your app](../tutorial/quick-start.md#run-your-app). From 375ac3e6ec6f925d8cd0959317317d0ba5b1e69d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 9 Sep 2015 13:35:07 +0800 Subject: [PATCH 28/36] Update brightray, fixes #2669 --- vendor/brightray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/brightray b/vendor/brightray index 8d64120b51b4..9b3695cfd5c4 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 8d64120b51b48be46eaa419957b965c0ccfc6c8f +Subproject commit 9b3695cfd5c48a4cdc90e84a863851001ce8dd10 From 446235c8cdfc979d5cc8917000288ca2f252f745 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 9 Sep 2015 15:55:26 +0800 Subject: [PATCH 29/36] Fix backward compatibility with old BrowserWindow options --- atom/browser/api/atom_api_window.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 4acd101f3c98..7403a7ecbb77 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -70,14 +70,13 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) { options.Get(switches::kWebPreferences, &web_preferences); // Be compatible with old options which are now in web_preferences. - std::string str; - double d; - if (options.Get(switches::kNodeIntegration, &str)) - web_preferences.Set(switches::kNodeIntegration, str); - if (options.Get(switches::kPreloadScript, &str)) - web_preferences.Set(switches::kPreloadScript, str); - if (options.Get(switches::kZoomFactor, &d)) - web_preferences.Set(switches::kZoomFactor, d); + v8::Local value; + if (options.Get(switches::kNodeIntegration, &value)) + web_preferences.Set(switches::kNodeIntegration, value); + if (options.Get(switches::kPreloadScript, &value)) + web_preferences.Set(switches::kPreloadScript, value); + if (options.Get(switches::kZoomFactor, &value)) + web_preferences.Set(switches::kZoomFactor, value); // Creates the WebContents used by BrowserWindow. auto web_contents = WebContents::Create(isolate, web_preferences); From c2b2a2072fb87bf2701a101c14cf887ba84fb2cd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 9 Sep 2015 16:11:45 +0800 Subject: [PATCH 30/36] spec: Set node-integration in window.open should work --- spec/chromium-spec.coffee | 19 +++++++++++++++---- spec/fixtures/pages/window-opener-node.html | 7 +++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 spec/fixtures/pages/window-opener-node.html diff --git a/spec/chromium-spec.coffee b/spec/chromium-spec.coffee index c594a97f3b83..d09a021db9f9 100644 --- a/spec/chromium-spec.coffee +++ b/spec/chromium-spec.coffee @@ -36,11 +36,20 @@ describe 'chromium feature', -> describe 'window.open', -> it 'returns a BrowserWindowProxy object', -> - b = window.open 'about:blank', 'test', 'show=no' + b = window.open 'about:blank', '', 'show=no' assert.equal b.closed, false assert.equal b.constructor.name, 'BrowserWindowProxy' b.close() + it 'accepts "node-integration" as feature', (done) -> + listener = (event) -> + window.removeEventListener 'message', listener + b.close() + assert.equal event.data, 'undefined' + done() + window.addEventListener 'message', listener + b = window.open "file://#{fixtures}/pages/window-opener-node.html", '', 'node-integration=no,show=no' + describe 'window.opener', -> ipc = remote.require 'ipc' url = "file://#{fixtures}/pages/window-opener.html" @@ -58,19 +67,21 @@ describe 'chromium feature', -> w.loadUrl url it 'is not null for window opened by window.open', (done) -> - b = window.open url, 'test2', 'show=no' + b = window.open url, '', 'show=no' ipc.on 'opener', (event, opener) -> b.close() done(if opener isnt null then undefined else opener) describe 'window.opener.postMessage', -> it 'sets source and origin correctly', (done) -> - b = window.open "file://#{fixtures}/pages/window-opener-postMessage.html", 'test', 'show=no' - window.addEventListener 'message', (event) -> + listener = (event) -> + window.removeEventListener 'message', listener b.close() assert.equal event.source.guestId, b.guestId assert.equal event.origin, 'file://' done() + window.addEventListener 'message', listener + b = window.open "file://#{fixtures}/pages/window-opener-postMessage.html", '', 'show=no' describe 'creating a Uint8Array under browser side', -> it 'does not crash', -> diff --git a/spec/fixtures/pages/window-opener-node.html b/spec/fixtures/pages/window-opener-node.html new file mode 100644 index 000000000000..118603c82d3b --- /dev/null +++ b/spec/fixtures/pages/window-opener-node.html @@ -0,0 +1,7 @@ + + + + + From 9d51da505e24c97332159fe077bf35cd3642fc0b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 9 Sep 2015 19:27:08 +0800 Subject: [PATCH 31/36] Run destruction callbacks before message loop gets destroyed --- atom/browser/atom_browser_main_parts.cc | 12 ++++++++++-- atom/browser/atom_browser_main_parts.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index 61b98dfc40ec..a1a1192b2768 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -39,8 +39,6 @@ AtomBrowserMainParts::AtomBrowserMainParts() } AtomBrowserMainParts::~AtomBrowserMainParts() { - for (const auto& callback : destruction_callbacks_) - callback.Run(); } // static @@ -118,4 +116,14 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { #endif } +void AtomBrowserMainParts::PostMainMessageLoopRun() { + brightray::BrowserMainParts::PostMainMessageLoopRun(); + + // Make sure destruction callbacks are called before message loop is + // destroyed, otherwise some objects that need to be deleted on IO thread + // won't be freed. + for (const auto& callback : destruction_callbacks_) + callback.Run(); +} + } // namespace atom diff --git a/atom/browser/atom_browser_main_parts.h b/atom/browser/atom_browser_main_parts.h index 59ff7c977c82..bcebc86f16ca 100644 --- a/atom/browser/atom_browser_main_parts.h +++ b/atom/browser/atom_browser_main_parts.h @@ -41,6 +41,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts { // content::BrowserMainParts: void PostEarlyInitialization() override; void PreMainMessageLoopRun() override; + void PostMainMessageLoopRun() override; #if defined(OS_MACOSX) void PreMainMessageLoopStart() override; void PostDestroyThreads() override; From 93bbc0bca9fbb6d8290e900e1f82d5619c0bbff4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 9 Sep 2015 19:27:28 +0800 Subject: [PATCH 32/36] Don't reference RequestContextGetter in JS objects V8 doesn't guarrentee the C++ class of JS objects will get destroyed, so this will result in RequestContextGetter never getting freed --- atom/browser/api/atom_api_cookies.h | 2 +- atom/browser/api/atom_api_protocol.h | 6 +++--- atom/browser/net/js_asker.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atom/browser/api/atom_api_cookies.h b/atom/browser/api/atom_api_cookies.h index 12cf4a220979..0c309b3f18ee 100644 --- a/atom/browser/api/atom_api_cookies.h +++ b/atom/browser/api/atom_api_cookies.h @@ -78,7 +78,7 @@ class Cookies : public mate::Wrappable { // Must be called on IO thread. net::CookieStore* GetCookieStore(); - scoped_refptr request_context_getter_; + net::URLRequestContextGetter* request_context_getter_; DISALLOW_COPY_AND_ASSIGN(Cookies); }; diff --git a/atom/browser/api/atom_api_protocol.h b/atom/browser/api/atom_api_protocol.h index 966fcd8726b3..9f98eb767309 100644 --- a/atom/browser/api/atom_api_protocol.h +++ b/atom/browser/api/atom_api_protocol.h @@ -66,7 +66,7 @@ class Protocol : public mate::Wrappable { public: CustomProtocolHandler( v8::Isolate* isolate, - scoped_refptr request_context, + net::URLRequestContextGetter* request_context, const Handler& handler) : isolate_(isolate), request_context_(request_context), @@ -83,7 +83,7 @@ class Protocol : public mate::Wrappable { private: v8::Isolate* isolate_; - scoped_refptr request_context_; + net::URLRequestContextGetter* request_context_; Protocol::Handler handler_; DISALLOW_COPY_AND_ASSIGN(CustomProtocolHandler); @@ -172,7 +172,7 @@ class Protocol : public mate::Wrappable { // Convert error code to string. std::string ErrorCodeToString(ProtocolError error); - scoped_refptr request_context_getter_; + net::URLRequestContextGetter* request_context_getter_; // Map that stores the original protocols of schemes. using OriginalProtocolsMap = base::ScopedPtrHashMap< diff --git a/atom/browser/net/js_asker.h b/atom/browser/net/js_asker.h index 9c45446abcbb..8ec245ee8c4f 100644 --- a/atom/browser/net/js_asker.h +++ b/atom/browser/net/js_asker.h @@ -46,7 +46,7 @@ class JsAsker : public RequestJob { // Called by |CustomProtocolHandler| to store handler related information. void SetHandlerInfo( v8::Isolate* isolate, - scoped_refptr request_context_getter, + net::URLRequestContextGetter* request_context_getter, const JavaScriptHandler& handler) { isolate_ = isolate; request_context_getter_ = request_context_getter; @@ -57,7 +57,7 @@ class JsAsker : public RequestJob { virtual void StartAsync(scoped_ptr options) = 0; net::URLRequestContextGetter* request_context_getter() const { - return request_context_getter_.get(); + return request_context_getter_; } private: @@ -89,7 +89,7 @@ class JsAsker : public RequestJob { } v8::Isolate* isolate_; - scoped_refptr request_context_getter_; + net::URLRequestContextGetter* request_context_getter_; JavaScriptHandler handler_; base::WeakPtrFactory weak_factory_; From 9dc6cfc1e9e482da4560785755cbc471d112200c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 9 Sep 2015 16:26:10 +0800 Subject: [PATCH 33/36] Bump v0.32.1 --- atom.gyp | 2 +- atom/browser/resources/mac/Info.plist | 2 +- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atom.gyp b/atom.gyp index 547bc3c38af5..c78fee1c8e60 100644 --- a/atom.gyp +++ b/atom.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '0.32.0', + 'version%': '0.32.1', }, 'includes': [ 'filenames.gypi', diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 884cdcd1a1ea..86eef9c09e78 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,7 +17,7 @@ CFBundleIconFile atom.icns CFBundleVersion - 0.32.0 + 0.32.1 LSMinimumSystemVersion 10.8.0 NSMainNibFile diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 16c7f0311f89..bfb464b990a3 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,32,0,0 - PRODUCTVERSION 0,32,0,0 + FILEVERSION 0,32,1,0 + PRODUCTVERSION 0,32,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "0.32.0" + VALUE "FileVersion", "0.32.1" 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.0" + VALUE "ProductVersion", "0.32.1" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index e270498e40bf..c1d11c91dc87 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 0 #define ATOM_MINOR_VERSION 32 -#define ATOM_PATCH_VERSION 0 +#define ATOM_PATCH_VERSION 1 #define ATOM_VERSION_IS_RELEASE 1 From 590be75fa98bba86608e00fef446f6c564e5e780 Mon Sep 17 00:00:00 2001 From: Gohy Leandre Date: Mon, 31 Aug 2015 11:18:10 +0200 Subject: [PATCH 34/36] add ValidatedUrl to did-fail-load event --- atom/browser/api/atom_api_web_contents.cc | 4 ++-- atom/renderer/lib/web-view/guest-view-internal.coffee | 2 +- docs/api/web-contents.md | 1 + docs/api/web-view-tag.md | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 9cb52a1ec74d..7c37f17e10d9 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -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() { diff --git a/atom/renderer/lib/web-view/guest-view-internal.coffee b/atom/renderer/lib/web-view/guest-view-internal.coffee index 44db5e304db4..b491184fb8d7 100644 --- a/atom/renderer/lib/web-view/guest-view-internal.coffee +++ b/atom/renderer/lib/web-view/guest-view-internal.coffee @@ -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': [] diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 89afae43d1c0..a3d3c360fff6 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -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. diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 850390702168..ff12110fac84 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -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. From 5089929be8e9b919106c8879908beea4cbbcedec Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Wed, 9 Sep 2015 21:34:20 +0300 Subject: [PATCH 35/36] Update README.md Capitalized the "Formerly known..." text + rearranged the community section and mention the slack channel. --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 68518052c016..54b6af5fa3fc 100644 --- a/README.md +++ b/README.md @@ -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. From 70af2e0bee5cfadc45b08d489370e03d7e993e0c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 10 Sep 2015 11:15:35 +0800 Subject: [PATCH 36/36] osx: Don't warn about unkown warning option We can not make every compiler happy. --- common.gypi | 1 + 1 file changed, 1 insertion(+) diff --git a/common.gypi b/common.gypi index a95e05620f02..7c41c3616dfb 100644 --- a/common.gypi +++ b/common.gypi @@ -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',