Commit graph

997 commits

Author SHA1 Message Date
Hari Juturu
9120774c00 Fixing uncaught exception on window close 2017-08-15 14:59:48 -07:00
Kevin Sawicki
34fff57646 Grant the devtools access to the extension origins 2017-08-15 16:19:21 +03:00
Thiago de Arruda
1709b8e39d Fix sandbox crash when opening a background tab
When a link is clicked with the middle mouse button, chrome opens a window with
"background-tab" disposition. This is not currently handled in sandbox mode,
causing an api::WebContents to leak leading to eventual crash(since it has no
wrapper).

Also fix the event handler for "-add-new-contents" by having it call
`event.preventDefault()` when the window creation should be cancelled.
2017-08-15 09:55:39 -03:00
John Kleinschmidt
72d2e176dd Merge pull request #10160 from liusy182/liusy182-10128-asar
Return empty string when fs.readFile with 'utf8' option from asar file
2017-08-07 21:42:15 -04:00
John Kleinschmidt
ccdff72ee4 Merge pull request #9918 from alexstrat/add-extensions-loading-api
Introduce Chrome extensions management APIs independent of Dev Tools Extensions
2017-08-07 20:06:22 -04:00
Siyuan Liu
f56abac7a8 fix linting error 2017-08-01 17:52:48 +08:00
Siyuan Liu
5a48c1feed fixes 10128 2017-07-31 09:32:45 +08:00
Samuel Attard
59e85c0f33 Fix stupid or check in scrubber defaults 2017-07-27 17:49:05 +10:00
Cheng Zhao
bd87982b5c Merge pull request #10075 from alexstrat/fix/fix-content_scripts-match
Fix content scripts matches
2017-07-24 15:27:55 +09:00
Cheng Zhao
25f168cecb Merge pull request #9951 from alexstrat/fix-chrome-storage
Fix chrome storage access scope
2017-07-24 14:01:15 +09:00
Alexandre Lachèze
a2ba4e0a6a fix content scripts matches 2017-07-20 20:01:49 +02:00
Alexandre Lachèze
498f344e2e Correct mkdir 2017-07-20 19:50:55 +02:00
Kevin Sawicki
959231f766 Merge pull request #9834 from shubham2892/input-type-file-treating-packaged-app-as-directory
Fix treat packaged app as directory
2017-07-18 10:21:07 -07:00
Shubham
b25a1d10a2 🍎 Add treatPackageasDirectory as an option 2017-07-18 10:13:25 -07:00
Kevin Sawicki
fc53ac3d38 Always register closed listeners 2017-07-17 11:55:16 -07:00
Kevin Sawicki
86b1deedfa Inherit enabled-sandbox in opened windows 2017-07-17 11:55:15 -07:00
Kevin Sawicki
61167ca296 Inherit nativeWindowOpen from parent window 2017-07-17 11:55:15 -07:00
Kevin Sawicki
553021bc9c Only assign opener when not using nativeWindowOpen 2017-07-17 11:55:15 -07:00
Alexandre Lachèze
ec8407c65d Recursively mkdir the parent directories 2017-07-11 00:56:45 +02:00
Alexandre Lachèze
c85f3cbd2c Change storage implementation to async 2017-07-11 00:35:53 +02:00
Alexandre Lachèze
9aac8967aa 👕 2017-07-10 23:56:44 +02:00
Alexandre Lachèze
969c74b886 Use es6 string templating 2017-07-10 23:50:59 +02:00
Alexandre Lachèze
73e8769b1f content_scripts[].matches use the URL without hash part 2017-07-07 04:14:36 +02:00
Alexandre Lachèze
ec10338364 Per-extension storage 2017-07-07 03:13:19 +02:00
Alexandre Lachèze
d2002ff3fc Use a file as Chrome Storage rather than localStorage 2017-07-07 03:06:53 +02:00
Alexandre Lachèze
03ec155ecb Oops 2017-07-05 17:34:04 +02:00
Alexandre Lachèze
cba53604eb Introduce extensions management APIs indépendant of Dev Tools Extensions
- introduce API BrowserWindow#[add,remove,get]Extension
- make [add,remove, get]DevToolsExtension use newly introduced API
- make the app persist only the extensions added via
#addDevToolsExtension
2017-07-03 20:01:08 +02:00
Kevin Sawicki
2cd49f3036 Merge pull request #9644 from electron/webview-sandbox
Enable sandbox on webview
2017-06-28 10:10:25 -07:00
Kevin Sawicki
14178d9826 Expose argv to preload process object 2017-06-26 13:52:19 -07:00
Cheng Zhao
5fbcb6ef4e Merge pull request #9396 from drulm/printtopdf-custom-pagesize
Add Math.ceil to pageSize.height and pageSize.width to printToPDF() o…
2017-06-26 14:48:44 +09:00
Kevin Sawicki
f9f697298d Add FIXME link to #6828 2017-06-14 14:12:51 -07:00
Kevin Sawicki
626a1550dc Send cached visibility state when guest DOM is ready 2017-06-14 14:11:38 -07:00
Boik
2e9ace6f59 Use Buffer.from instead of deprecated new Buffer
Use Buffer.from instead of deprecated new Buffer.
2017-06-12 16:57:42 +08:00
Vanessa Yuen
43271c162a use includes instead of indexOf 2017-06-09 14:45:47 -07:00
Matthias Niess
254dcdaa45 add tray icon workaround for newer Ubuntu releases (fixes #9046) 2017-06-09 15:22:18 +02:00
Birunthan Mohanathas
7d2226e05e Let Chromium manage document.visibilityState and document.hidden
Chromium already includes the necessary plumbing to manage the
visibility properties and `visibilitychange` event so this gets rid of
most of our custom logic for `BrowserWindow` and `BrowserView`.

Note that `webview` remains unchanged and is still affected by the issues
listed below.

User facing changes:

- The `document` visibility properties and `visibilitychange` event are
  now also updated/fired in response to occlusion changes on macOS. In
  other words, `document.visibilityState` will now be `hidden` on macOS
  if the window is occluded by another window.

- Previously, `visibilitychange` was also fired by *both* Electron and
  Chromium in some cases (e.g. when hiding the window). Now it is only
  fired by Chromium so you no longer get duplicate events.

- The visiblity state of `BrowserWindow`s created with `{ show: false }`
  is now initially `visible` until the window is shown and hidden.

- The visibility state of `BrowserWindow`s with `backgroundThrottling`
  disabled is now permanently `visible`.

This should also fix #6860 (but not for `webview`).
2017-06-06 15:16:01 -07:00
Kevin Sawicki
53b6ee0e3f Merge pull request #9468 from tonyganch/9296-history-state
Remove page url check during `history.pushState`
2017-06-05 14:47:49 -07:00
Cheng Zhao
e82af41591 Merge pull request #9269 from electron/main-notifications
Notifications from the main process
2017-05-31 17:21:05 +09:00
Samuel Attard
3938373ecb
Fix linting errors and add isSupported 2017-05-30 20:27:24 +10:00
Kevin Sawicki
e735aa7dee web-preferences -> webPreferences 2017-05-26 10:10:36 -07:00
Kevin Sawicki
9ac2cf0d44 Add comment about disablePopups setting 2017-05-26 10:10:36 -07:00
Kevin Sawicki
dbd240a7cb Return null from native window.open when allowpopups is unset 2017-05-26 10:10:36 -07:00
Kevin Sawicki
4e9efebf47 🎨 2017-05-26 10:10:36 -07:00
Kevin Sawicki
47759a01de Only forward events when nativeWindowOpen is set 2017-05-26 10:10:36 -07:00
Kevin Sawicki
7baf472c0f Implement BrowserPluginGuestDelegate::CreateNewGuestWindow for nativeWindowOpen 2017-05-26 10:10:36 -07:00
Tony Ganch
3a9b035d36 Remove page url check in history.pushState
Current implementation of NavigationController does not allow using
`history.pushState()` if page url is not changed.
It worked by mistake in versions < 1.3.6 and got visible after fix 180a77e6.
2017-05-23 22:42:33 +02:00
Samuel Attard
5dd4d6a961
macOS implementation of notifications in the main process 2017-05-23 02:05:13 +10:00
Kevin Sawicki
a285a3e64b Default webviewTag to false 2017-05-17 14:01:45 -07:00
Kevin Sawicki
9e88d337ec Inherit webviewTag setting from parent window 2017-05-17 13:37:23 -07:00
Kevin Sawicki
bde13353fb Rename option to webviewTag and default to nodeIntegration value 2017-05-17 13:12:23 -07:00
Kevin Sawicki
837ea884de Merge remote-tracking branch 'origin/master' into enable-webview 2017-05-17 12:45:29 -07:00
Thiago de Arruda
6b5bd3b6ce Fix how rpc-server releases references after page reload
In addition to listening for "render-view-deleted", listen for
"ELECTRON_BROWSER_CONTEXT_RELEASE" synchronous message, which is sent by the
remote module when the page is about to be navigated.

This is required to allow child windows running in the same renderer to
correctly manage remote object references, since `render-view-deleted` is only
called when the renderer exits.

Close #9387
2017-05-16 09:05:52 -03:00
Ryohei Ikegami
7ac93045b7 Merge branch 'master' into native-window-open 2017-05-11 13:51:43 +09:00
HariJ
a05eb9047e Fixing missed variable name 2017-05-08 18:50:20 -07:00
Hari Krishna Reddy Juturu
3321f7d39c Changing command line option name 2017-05-08 17:27:31 -07:00
Hari Krishna Reddy Juturu
94d054cf11 Add option to override webview security 2017-05-06 22:10:42 -07:00
Hari Krishna Reddy Juturu
b4a8ed01f1 PR 44648: Enabling creation on webview with node-integration disabled and raising events
- Enabling creation on webview with node-integration disabled and raising events

Conflicts:
	lib/browser/guest-view-manager.js
2017-05-06 20:50:01 -07:00
Darrell Ulm
fa2bfd3ff5 Add Math.ceil to pageSize.height and pageSize.width to printToPDF() options to prevent error on display. 2017-05-06 19:19:31 -04:00
Kevin Sawicki
70e199e255 Merge pull request #9333 from electron/process-memory-info-sandbox
Expose `process.get{System,Process}MemoryInfo` to sandbox
2017-05-04 14:17:44 -07:00
Kevin Sawicki
eebae82bc1 Merge pull request #9315 from electron/segmented-control-mode
Add mode prop to segmented touch bar control
2017-05-04 14:16:28 -07:00
Samuel Attard
718dc732ad
Add docs and add isSelected arg 2017-05-03 20:25:50 +10:00
Kevin Sawicki
fa4ec11a12 Use isSameOrigin helper when posting message 2017-05-01 08:45:38 -07:00
Thiago de Arruda
bbe21cce67 Expose more atom_bindings.cc functions to sandbox 2017-05-01 09:12:39 -03:00
deepak1556
5e976be43b remove page-title-updated workaround for #3380 2017-05-01 16:53:55 +09:00
Ryohei Ikegami
8b6b512485 Pass nativeWindowOpen flag to isolated init.js 2017-04-30 19:35:41 +09:00
Samuel Attard
225ccab3d2
Add mode prop to segmented touch bar control 2017-04-28 14:50:58 +10:00
Ryohei Ikegami
1d73e84a29 Merge branch 'master' into native-window-open 2017-04-27 12:03:55 +09:00
Kevin Sawicki
95ef422ab4 Coerce offset to number in renderer process 2017-04-26 12:37:16 -07:00
Kevin Sawicki
507f60e33e Don't allow webPreferences to be overrideden in features string 2017-04-26 10:56:53 -07:00
Kevin Sawicki
91a1e5cdfe Store frame to guests in map 2017-04-26 10:14:11 -07:00
Kevin Sawicki
2c48300daa Fix typos in comment 2017-04-26 09:09:42 -07:00
Kevin Sawicki
246937a372 Convert targetOrigin to string in render process 2017-04-26 09:08:47 -07:00
Kevin Sawicki
3894c1c625 Convert frameName/features to strings in render process 2017-04-26 09:08:47 -07:00
Kevin Sawicki
05b6d91bf4 Disable node integration in chrome-devtools: URLs 2017-04-25 13:36:08 -07:00
Kevin Sawicki
3e2a1034af Disable JavaScript on child when disabled on parent 2017-04-25 12:57:53 -07:00
Kevin Sawicki
6ec74060b4 Enable setting javascript and contextIsolation via window.open 2017-04-25 12:57:53 -07:00
Kevin Sawicki
c90fd4dc88 Convert message/title to strings in render process 2017-04-24 09:15:01 -07:00
Kevin Sawicki
a004cada7c Merge pull request #9095 from seanchas116/better-path-resolve
Search for module from app path when URL is not file protocol
2017-04-20 10:49:53 -07:00
Kevin Sawicki
de62f1ea6c Restart crash service in each spec 2017-04-19 16:37:24 -07:00
Samuel Attard
11c7c107a9 add iconPosition property to touch bar buttons 2017-04-18 08:56:39 -07:00
Ryohei Ikegami
8dff29185b Merge branch 'master' into native-window-open 2017-04-18 21:59:22 +09:00
Birunthan Mohanathas
8b9f7e5b00 Implement initial, experimental BrowserView API
Right now, `<webview>` is the only way to embed additional content in a
`BrowserWindow`. Unfortunately `<webview>` suffers from a [number of
problems](https://github.com/electron/electron/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3Awebview%20).
To make matters worse, many of these are upstream Chromium bugs instead
of Electron-specific bugs.

For us at [Figma](https://www.figma.com), the main issue is very slow
performance.

Despite the upstream improvements to `<webview>` through the OOPIF work, it is
probable that there will continue to be `<webview>`-specific bugs in the
future.

Therefore, this introduces a `<webview>` alternative to called `BrowserView`,
which...

- is a thin wrapper around `api::WebContents` (so bugs in `BrowserView` will
  likely also be bugs in `BrowserWindow` web contents)

- is instantiated in the main process like `BrowserWindow` (and unlike
  `<webview>`, which lives in the DOM of a `BrowserWindow` web contents)

- needs to be added to a `BrowserWindow` to display something on the screen

This implements the most basic API. The API is expected to evolve and change in
the near future and has consequently been marked as experimental. Please do not
use this API in production unless you are prepared to deal with breaking
changes.

In the future, we will want to change the API to support multiple
`BrowserView`s per window. We will also want to consider z-ordering
auto-resizing, and possibly even nested views.
2017-04-13 01:27:27 +03:00
Thiago de Arruda
ce1a5e3c9c Fix sandboxed crashReporter for windows.
- Use `path` module from browser process in sandboxed renderer. This is required
  because the return value of `path.join` is platform-specific, and this is an
  assumtion of crash-reporter.js which is shared between sandboxed and
  non-sandboxed renderers.
- Set `process.platform` and `process.execPath` in sandboxed renderer
  environment. This is required to spawn the windows crash service from
  sandboxed renderer.
- Use a single temporary directory for all crashReporter tests. This is required
  to make tests more deterministic across platforms(since mac's crashpad doesn't
  support changing the crash dump directory). Also make a few improvements/fixes
  to the `uploadToServer` test.
2017-04-05 18:09:24 -03:00
Samuel Attard
bea56bbdc8 Update as per feedback 2017-04-04 13:51:38 -07:00
Samuel Attard
2fd62d090a Allow items to be assigned to multiple popovers 2017-04-04 13:51:33 -07:00
Samuel Attard
f05dfc74da Store parent popover in popover touch bar items 2017-04-04 13:51:13 -07:00
Kevin Sawicki
74a3a34caa Add spec for interaction event with escape item 2017-04-04 13:14:56 -07:00
Kevin Sawicki
bbadeb62ac Check that escape item is non-null before checking id 2017-04-04 13:12:29 -07:00
Kevin Sawicki
414540bfcb Support passing escape item to TouchBar constructor 2017-04-04 12:50:41 -07:00
Kevin Sawicki
b24b4212c5 Make escape item a property instead of setter 2017-04-04 12:50:41 -07:00
Kevin Sawicki
21c1ddffb3 Handle change and interaction events on escape items 2017-04-04 12:50:41 -07:00
Kevin Sawicki
591cd8d073 Update window via listener when escape item changes 2017-04-04 12:50:41 -07:00
Kevin Sawicki
d596d85288 🎨 2017-04-04 12:50:41 -07:00
Samuel Attard
60cc862031 Make everything pointer like 2017-04-04 12:50:41 -07:00
Samuel Attard
4d6b0fc01b Add a method to set the escape identifier on the touch bar 2017-04-04 12:50:41 -07:00
Kevin Sawicki
fdd36334e5 Match args style of other IPC handlers 2017-04-04 11:18:16 -07:00
Kevin Sawicki
7065123266 Wrap remote value being set as an arg 2017-04-04 11:18:16 -07:00
Kevin Sawicki
3e9014c371 Merge pull request #9099 from electron/certificate-trust
macOS: Add certificate trust API
2017-04-04 11:17:09 -07:00
Kevin Sawicki
2e32525e8f Make browser window optional 2017-04-04 10:49:10 -07:00
joshaber
2749ded062 Fix c&p error 2017-04-04 11:45:27 -04:00
Ryohei Ikegami
61fa8693d2 Merge branch 'master' into native-window-open 2017-04-04 20:54:37 +09:00
joshaber
e2bda3ca0f Use an options object for most of the params 2017-04-03 21:33:21 -04:00
Ryohei Ikegami
4a7eec8f2d Pass app path as command line argument 2017-04-04 09:36:01 +09:00
joshaber
0b7ffd094a Expose through the actual JS API too 2017-04-03 15:25:06 -04:00
Kevin Sawicki
e85e483c71 Parse setting response to surface thrown errors 2017-04-03 12:16:51 -07:00
Ryohei Ikegami
001d03c859 Do not add search paths in devtools 2017-04-03 22:40:36 +09:00
Ryohei Ikegami
50c99e4507 Search for module under the app directory 2017-04-03 20:19:10 +09:00
Kevin Sawicki
fcb7cbc54a Check name directly instead of arguments length 2017-03-30 14:03:00 -07:00
Thiago de Arruda
b3cf00a19a Fix net module to accept non-string header values
This is required to be compatible with node.js http module.
2017-03-30 16:01:40 -03:00
Kevin Sawicki
57edc28b0d Merge pull request #8880 from mst128256/2814
Default menu items for 'Edit' and 'Window' #2814
2017-03-29 12:31:58 -07:00
Kevin Sawicki
8b4bf1f29e 🎨 2017-03-29 12:29:36 -07:00
mst128256
6ae198a625 Empty objects within default menu replaced by nulls 2017-03-29 12:50:31 +02:00
deepak1556
3ae62615f4 net: allow controlling redirects 2017-03-28 18:46:21 +05:30
Ryohei Ikegami
9edfbab89f Add comment why defaultPrevented = false 2017-03-28 19:58:58 +09:00
Ryohei Ikegami
de2019f6b8 Change webContents -> options.webContents 2017-03-28 19:58:23 +09:00
mst128256
9e471d8f1c Added specs 2017-03-24 12:14:08 +01:00
Ryohei Ikegami
4e473897b7 Use === 2017-03-24 11:08:08 +09:00
Ryohei Ikegami
6f9dbd4e04 Merge branch 'master' into native-window-open 2017-03-24 00:11:43 +09:00
Ryohei Ikegami
deba6553f5 Better preventDefault for ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN 2017-03-23 23:51:33 +09:00
Thiago de Arruda
3a97cfc359 Expose crashReporter to sandbox 2017-03-23 10:01:02 -03:00
Thiago de Arruda
e1aebef57c Make sandbox APIs more compatible with normal renderers
- Expose remote shortcuts for the `fs`, `os` and `child_process` modules.
- Expose the `url` and `timers` modules(the browserify versions)
- Add `process.crash` and `process.platform`
2017-03-23 10:01:02 -03:00
Cheng Zhao
e539129db2 Merge pull request #8852 from electron/web-worker-hook
Add Node.js integration to WebWorker
2017-03-22 09:01:42 -07:00
Ryohei Ikegami
d3252e0eb1 Reuse existing event 2017-03-21 16:09:53 +09:00
Kevin Sawicki
23b235c9c7 Default async to false when object is specified 2017-03-20 20:37:52 -07:00
Cheng Zhao
bb5ad4ac05 Correctly initialize Node environment in worker 2017-03-20 12:52:45 -07:00
Kevin Sawicki
286f529968 Merge pull request #8890 from twolfson/dev/proxy.to.string.sqwished
🐛 Add toString support to remote functions
2017-03-20 09:35:51 -07:00
Ryohei Ikegami
076427673e Fix JavaScript style 2017-03-19 18:20:10 +09:00
Ryohei Ikegami
319a7759d0 Fix ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN handler 2017-03-19 17:52:39 +09:00
Ryohei Ikegami
a1f9a45276 Use native window.open implementation 2017-03-19 17:41:20 +09:00
Kevin Sawicki
c50b518493 Check toString after loading remote properties 2017-03-17 10:29:07 -07:00
Kevin Sawicki
f71353a4c5 Merge pull request #8939 from electron/expose-remote-to-sandbox
Expose remote module to sandbox
2017-03-17 09:41:59 -07:00
Todd Wolfson
818738ce84 🐛 Add toString support to remote functions 2017-03-17 08:21:37 -07:00
Thiago de Arruda
e9b955b9ec Use remote/fs to read preload script during sandboxed setup
Also expose the "fs" module to preload scripts, as a shortcut to
`require('electron').remote.require('fs')`
2017-03-16 14:23:00 -03:00
Thiago de Arruda
f6befbe764 Expose lib/renderer/api/remote.js to sandboxed renderer 2017-03-16 14:21:23 -03:00
Kevin Sawicki
6d45052eea Merge pull request #8900 from electron/handle-buffer-instances-in-sandbox
Handle Buffer deserialization in sandboxed renderers
2017-03-16 10:12:09 -07:00
Thiago de Arruda
a6e4867111 Handle Buffer deserialization in sandboxed renderers
In sandboxed renderers we use browserify to provide a node-like environment. The
Buffer class used by browserify is actually just a wrapper around Uint8Array,
but to deserialize Buffer correctly we must expose the class as a hidden value
and use it in V8ValueConverter.
2017-03-16 13:20:09 -03:00
Kevin Sawicki
da0d0e7aac Merge pull request #8910 from electron/touchbar-scrubber
Touchbar NSScrubber
2017-03-16 09:10:59 -07:00
Kevin Sawicki
bc31f05404 highlightedStyle -> overlayStyle 2017-03-15 09:47:07 -07:00
Kevin Sawicki
019883f2fa Merge pull request #8899 from electron/dynamically-generate-browserify-dep-list
Dynamically generate dependencies of browserify build actions
2017-03-15 09:12:31 -07:00
Kevin Sawicki
2e0e4e69bb Drop on prefix from property names 2017-03-14 14:02:48 -07:00
Samuel Attard
a55cddaa53
Add more options 2017-03-14 18:57:57 +11:00
deepak1556
bd9a9657aa disable node integration for chrome scheme 2017-03-14 00:26:27 +05:30
deepak1556
a2db14476a create webui message handler 2017-03-14 00:25:59 +05:30
deepak1556
fdd574cea5 browser: implement pdf renderer as webui 2017-03-14 00:25:59 +05:30
Kevin Sawicki
5e70adb511 Guard against only specifying select or highlight handler 2017-03-13 11:23:27 -07:00
mst128256
76ee7fda2b Fixed linting 2017-03-13 14:26:34 +01:00
Samuel Attard
a85ae27d68
Fix linting 2017-03-13 11:00:10 +11:00
Samuel Attard
25a231fc50
Initial NSScrubber implementation 2017-03-13 10:51:12 +11:00
Kevin Sawicki
280337bf46 Merge pull request #8887 from electron/touchbar-segmneted-control
Touchbar segmented control
2017-03-10 14:43:12 -08:00
Thiago de Arruda
da023b72ee Dynamically generate dependencies of browserify build actions
Instead of having to list in filenames.gypi every javascript file that may go
into a browserify build, generate this list dynamically when the build files are
created by gyp.
2017-03-10 16:30:23 -03:00