Commit graph

11099 commits

Author SHA1 Message Date
Thiago de Arruda
47fd41715f Add some tests for "sandbox" option 2016-09-27 06:01:47 -03:00
Thiago de Arruda
a64978b812 Use the routing id on api::WebContents::GetID
The sandbox option allows multiple webContents in one renderer process, so using
the only the renderer id to identify WebContents instances is no longer an
option.

WebContents::GetID now returns a 64-bit integer, which is composed of both the
process id(high 32), and the RenderViewHost routing id(low 32). Also add a
`GetProcessID` that retrieves the renderer process id, a requirement in some of
our javascript code.
2016-09-27 06:01:47 -03:00
Thiago de Arruda
524bab530a Improve AtomSandboxedRendererClient to support preload scripts.
Add RenderFrameObserver/RenderViewObserver subclasses that implement the
necessary support for preload scripts in sandboxed renderers.
2016-09-27 06:01:47 -03:00
Thiago de Arruda
72154b64ed Embed setup bundle for preload scripts in sandboxed renderers.
Add a gyp target that creates a browserify bundle starting with
`lib/sandboxed_renderer/init.js`, which is embedded into the executable using
the `atom_js2c` target.

The goal of this bundle is to provide a very basic environment for preload
scripts where a `require` function is available.
2016-09-27 06:01:47 -03:00
Thiago de Arruda
695509e267 Add browser side support for reading files from renderer. 2016-09-27 06:01:46 -03:00
Thiago de Arruda
0f7652dc85 Move code that defines ipcRenderer methods into another file. 2016-09-27 06:01:46 -03:00
Thiago de Arruda
1713200084 Refactor the atom_js2c target to include javascript from multiple dirs.
Before invoking js2c, copy all files that must be embedded into the shared
intermediate directory, and modify the js2c wrapper script to include all files
from that directory(which is passed as argument).

This allows the build system to embed files that don't share a common base
directory, such as javascript generated at build time.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
6afe8aa7f2 Move EmitIPCEvent into AtomRenderViewObserver.
Refactor this function as a method so it is possible to inherit most behavior
from AtomRenderViewObserver and override EmitIPCEvent.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
c8629019f5 Expose atom_api_renderer_ipc module API 2016-09-27 06:01:46 -03:00
Thiago de Arruda
a7b6332ed0 Add atom::AtomSandboxedRendererClient class 2016-09-27 06:01:46 -03:00
Thiago de Arruda
06cc9a44fe Add support for native chromium popups on sandboxed renderers.
- Allow `api::Window` instances to be created from existing `api::WebContents`.
- Override `WebContentsCreated` and `AddNewContents` to wrap renderer-created
  `content::WebContents` into `api::WebContents`.
- For `content::WebContents` that should be displayed in new windows, pass the
  wrapped `api::WebContents` object to window manager.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
0b3b29938f Allow api::WebContents to fully wrap an existing content::WebContents.
- Add an overload to `WebContents::CreateFrom` that accepts a type parameter. If
  type is `REMOTE`, initialization is the same as before(a thin wrapper). If
  not, the `api::WebContents` will be fully initialized, as if it was created by
  `api::WebContents::Create`.
- Move common initialization code to `InitWithSessionAndOptions`.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
1b1541fe1a Decouple api::Window initialization from api::WebContents construction. 2016-09-27 06:01:46 -03:00
Thiago de Arruda
1d228446db Expose --enable-sandbox command-line switch.
When `--enable-sandbox` is passed, electron will use chromium sandbox to spawn
all renderers, and every new BrowserWindow will automatically have "sandboxed"
passed as a web preference(since the renderer would not work properly
otherwise).
2016-09-27 06:01:46 -03:00
Thiago de Arruda
c783ec72bc Add "sandboxed" option to "webPreferences".
When "sandboxed" is passed as a web preference for `BrowserWindow`, the newly
created renderer won't run any node.js code/integration, only communicating with
the system via the IPC API of the content module. This is a requirement for
running the renderer under chrome OS-level sandbox.

Beyond that, certain behaviors of AtomBrowserClient are modified when dealing
with sandboxed renderers:

- `OverrideSiteInstanceNavigation` no longer create a new `SiteInstance` for
  every navigation. Instead, it reuses the source `SiteInstance` when not
  navigating to a different site.
- `CanCreateWindow` will return true and allow javascript access.
2016-09-27 06:01:46 -03:00
Zeke Sikelianos
90c5972fce Merge pull request #7342 from tinydew4/update-changes
Update changes to korean docs.
2016-09-26 22:19:45 -07:00
Zeke Sikelianos
9c19b4e3d5 Merge pull request #7343 from tinydew4/translate-ko
Translate newest styleguide.md and update changes to system-preferences.md
2016-09-26 21:47:42 -07:00
arus
72e3816143 Change a word 2016-09-27 09:38:23 +09:00
arus
9dd181c206 Change some sentences after review 2016-09-27 09:34:59 +09:00
Zeke Sikelianos
9828926002 Merge pull request #7340 from tinydew4/fix-link
Fix broken link in original docs
2016-09-26 12:04:22 -07:00
Cheng Zhao
1dd05ff520 Merge pull request #7338 from electron/fix-get-accent-color-docs
Fix getAccentColor() docs in system-preferences.md
2016-09-26 15:39:40 +08:00
Cheng Zhao
19bd5ea8ba Merge pull request #7316 from tinydew4/update-ko
Update debugging-main-process and Add planned-breaking-changes
2016-09-26 12:56:22 +08:00
arus
bcf7a86dc7 Update changes to ko-KR/api 2016-09-26 00:03:32 +09:00
arus
2fbdac1034 Update changes to ko-KR/api/app.md 2016-09-25 23:50:36 +09:00
arus
577585df63 Update changes to ko-KR/api/power-monitor.md 2016-09-25 23:48:09 +09:00
arus
f13bd655a1 Update changes to ko-KR/api/screen.md 2016-09-25 23:45:56 +09:00
arus
81de0518d9 Update changes to ko-KR/api/web-contents.md 2016-09-25 23:43:24 +09:00
arus
d93a86e8cc Remove some changes 2016-09-25 23:37:34 +09:00
arus
7e186cee55 Remove some changes 2016-09-25 23:28:59 +09:00
arus
97da066ae2 Update changes to ko-KR/api/web-contents.md 2016-09-25 23:25:05 +09:00
arus
b58f73b5c9 Update change to ko-KR/README.md 2016-09-25 23:18:18 +09:00
arus
ad1cb16a76 Update changes to web-view-tag.md 2016-09-25 22:58:41 +09:00
arus
cd4a66dca5 Update changes to browser-window.md 2016-09-25 22:40:05 +09:00
arus
cc282a1114 Update /ko-KR/api/system-preferences.md 2016-09-25 21:57:43 +09:00
arus
270d6f774a Update changes to browser-window and correct a word 2016-09-25 21:40:33 +09:00
arus
66efaa5e0f Update /ko-KR/styleguide.md 2016-09-25 17:04:34 +09:00
arus
27a9f960de Fix broken link 2016-09-25 16:15:16 +09:00
arus
74e03d285e Fix broken link 2016-09-25 16:13:34 +09:00
arus
123f2a8265 Update /ko-KR/styleguide.md 2016-09-25 16:05:45 +09:00
arus
d25c2d0f41 Update /ko-KR/api/system-preferences.md 2016-09-25 16:05:45 +09:00
Vadim Macagon
1df30821db Fix getAccentColor() docs in system-preferences.md
Example was using a non-existent method.
2016-09-25 01:45:34 +07:00
Zeke Sikelianos
bf88fe32fd Merge pull request #7333 from tinydew4/translate-ko
Translate CODE_OF_CONDUCT and change a word as other docs, in korean
2016-09-24 10:04:04 -07:00
arus
e21d5bd380 Change some sentences more smoothly 2016-09-24 15:58:58 +09:00
arus
04bdc87283 Change some smoothly 2016-09-24 11:33:31 +09:00
arus
177ccbc014 Translate CODE_OF_CONDUCT and change a word as other docs, in korean 2016-09-24 10:37:17 +09:00
Zeke Sikelianos
d6cd9e3034 Merge pull request #7331 from tinydew4/fix-link
Fix broken links
2016-09-23 17:19:07 -07:00
Zeke Sikelianos
d391f1b527 Merge pull request #7330 from tinydew4/translate-ko
Translate accessibility and change some in korean
2016-09-23 17:07:40 -07:00
arus
8c7a4de27b Fix broken links 2016-09-24 08:26:25 +09:00
Arus
7cd7894878 Update accessibility.md 2016-09-24 08:23:36 +09:00
arus
d7fc7ef2ee Fix errata 2016-09-24 08:19:24 +09:00