Commit graph

267 commits

Author SHA1 Message Date
Cheng Zhao
44b8343585 Fix crash when closing page with webview 2016-01-13 14:47:39 +08:00
Kevin Sawicki
1f9691ae13 Convert all source files to JavaScript 2016-01-12 16:24:06 -08:00
Kevin Sawicki
403870a27e Migrate to block comments 2016-01-12 16:22:34 -08:00
Cheng Zhao
3a32dc5da7 Fix "name" of Error object not serialized
Close #3364.
2016-01-07 16:35:05 +08:00
Cheng Zhao
4844e68ba1 Rename did-navigate-to-different-page to did-navigate 2016-01-04 12:09:11 +08:00
Cheng Zhao
941232a76b Merge pull request #3975 from leethomas/add-webview-navigation-events
Add webview navigation events
2016-01-04 11:24:27 +08:00
leethomas
911e60b507 add did-navigate-in-page event to webview & webcontents (triggers on hash/ref changes, anchor links...), pass url into events 2016-01-01 17:13:39 -08:00
leethomas
9f6319dd71 add will-navigate, did-navigate-to-different-page events to webview 2016-01-01 13:36:35 -08:00
leethomas
96d68b9285 🐛 add isDevToolsFocused to WebContents to fix #3928, add devtools-[focused|open|close] events to WebView to fix #3783. 2015-12-31 22:21:54 -08:00
Robo
72374b6e31 remote: support arguments of type Date 2015-12-30 01:41:31 +05:30
Brian R. Bondy
11b2015535 Add did-change-theme-color event to webview 2015-12-22 17:28:22 -05:00
Robo
d162180196 add api to webview 2015-12-21 17:13:23 +05:30
Brian R. Bondy
fed0c43970 Add media play events to webview 2015-12-19 22:37:51 -05:00
Cheng Zhao
353f08e477 Remove sync call in remote module 2015-12-17 22:03:16 +08:00
Cheng Zhao
0282d424bf Pass opener ID in command line 2015-12-17 21:27:14 +08:00
Kevin Sawicki
d133553c6a Remove unused ipc event handler 2015-12-14 16:58:32 -08:00
Kevin Sawicki
184b11be4c Use id from source window when building proxy for event source 2015-12-14 16:47:33 -08:00
Kevin Sawicki
9bc7c62588 Use source origin in window.postMessage event 2015-12-10 16:52:39 -08:00
Kevin Sawicki
afd736d9f9 Guard against null guest or embedder
Uncaught exceptions would occur when these were null and
the target origin was '*'
2015-12-10 15:51:15 -08:00
Kevin Sawicki
ea1479a651 Revert comment tweak 2015-12-09 18:20:53 -08:00
Kevin Sawicki
fc724b51e8 Move event forwarding back to init 2015-12-09 18:11:38 -08:00
Kevin Sawicki
63c0095efb Emit process exit event with app exit code 2015-12-09 14:40:53 -08:00
Cheng Zhao
836a8b1794 Simplify the desktopCapturer code 2015-12-08 13:49:26 +08:00
Cheng Zhao
51368952a2 Remove deprecated API usages 2015-12-08 12:58:39 +08:00
Cheng Zhao
04f7ceab73 Merge branch 'master' into desktop-capture-api 2015-12-08 12:43:44 +08:00
Cheng Zhao
5e5ae81c53 'key of' is better than Object.keys 2015-12-04 11:40:35 +08:00
Cheng Zhao
2c6d232254 Don't add too much listeners in BrowserWindowProxy 2015-12-04 11:12:36 +08:00
Cheng Zhao
504d3d3088 Merge pull request #3670 from mixmaxhq/jeff/fix_window_open
Fix `window.open` not respecting the features string
2015-12-04 10:55:51 +08:00
Cheng Zhao
117b7462de window.id is no longer available when window is closed 2015-12-03 16:17:10 +08:00
Jeff Wear
225fe72d03 Ensure that window.open does not override the child options
Fixes https://github.com/atom/electron/issues/3652.
2015-12-02 12:00:51 -08:00
Cheng Zhao
e5974e44ed Deprecate the page-title-set event
We have two names for the same event, page-title-updated wins.
2015-12-01 18:50:56 +08:00
Cheng Zhao
8ce19d8059 Merge pull request #3586 from atom/ipc-fasterer
Ensure calling webview.send will not block the renderer
2015-11-26 13:15:08 +08:00
Paul Betts
789380dfad Ensure calling webview.send will not block the renderer
When the browser process is busy, calling webview.send (a method that appears
on its face to be non-blocking) will actually block, because most webview methods
are remoted to a guest view instance in the browser. Instead, define a few methods
which will instead send its call over an async IPC message.
2015-11-25 15:54:30 -08:00
Ryan Prichard
0f5a3baff4 Fix https://github.com/atom/electron/issues/3565 by adding a typeof 2015-11-24 16:49:52 -06:00
Cheng Zhao
1ee69540b0 Merge pull request #3484 from bengotow/remote-errors
Improve exception messages from remote calls
2015-11-18 18:21:02 +08:00
Ben Gotow
1022179a1f Improve exception messages from remote calls
Spent a while tracking down `Error processing argument -1`, caused by a missing param (`app.exit()` now takes an exit code.) Improve the rpc-server so that it prints the function name when possible, so it's much easier to identify which remote call is causing the error.
2015-11-17 17:36:37 -08:00
Cheng Zhao
b925ac0056 Send sync message to get list of modules 2015-11-13 22:15:16 +08:00
Cheng Zhao
099278855c Simplify how remote.require('electron') is optimized 2015-11-13 21:54:56 +08:00
Cheng Zhao
fbb8e61958 Replace "Url" in API names with "URL" 2015-11-13 16:03:40 +08:00
Cheng Zhao
2ca5a33d28 Add electron.hideInternalModules 2015-11-12 21:46:03 +08:00
Cheng Zhao
c649c4cf4f Rename the env to ELECTRON_HIDE_INTERNAL_MODULES 2015-11-12 21:37:44 +08:00
Cheng Zhao
8b2942c279 Optimize remote.require('electron') 2015-11-12 20:30:40 +08:00
Cheng Zhao
1d1f911b09 Use require('electron') in Electron's code 2015-11-12 20:29:30 +08:00
Cheng Zhao
f9d7e7ce55 Add ELECTRON_DISABLE_OLD_STYLE_MODULES env 2015-11-12 17:02:04 +08:00
Cheng Zhao
c2c09daa23 Add "electron" module 2015-11-12 16:40:27 +08:00
Cheng Zhao
b807685453 Deep copy the options
Otherwise a window's options is possible to be affected by others.
2015-11-11 10:37:34 +08:00
Cheng Zhao
737e22b003 Use minWidth style for options instead of min-width 2015-11-11 10:37:34 +08:00
Cheng Zhao
751af25f37 Use ipcMain in Electron's code 2015-11-10 16:04:34 +08:00
Cheng Zhao
91c4ed26fc Print warnings for deprecated APIs 2015-11-09 21:51:30 +08:00
Cheng Zhao
863199348f Make process.exit() quit gracefully
Instead of abrupting the whole program immediately, we should close all
windows and release all native resources gracefully on exit. This avoids
possible crashes.

Fix #3350.
2015-11-06 20:25:20 +08:00
Cheng Zhao
647a0c4e2b Code cleanup for remote module 2015-11-02 20:28:01 +08:00
Max Claus Nunes
bbb5aef5d2 Improve error handling from remote
This way copy all properties available in the error object and keep the real stack trace
2015-10-31 21:20:54 -02:00
Cheng Zhao
cb91d4487b Clean up the code handling renderer callback 2015-10-31 15:00:06 +08:00
Robo
2c59f4567e use webcontents id to identify callbacks 2015-10-30 19:51:19 +05:30
Robo
3a154ab8ea add line and column values to callback id 2015-10-29 21:21:30 +05:30
Robo
ac4df34ecd create binding to idweakmap 2015-10-29 17:51:56 +05:30
Robo
eae7c840b7 use idweakmap for holding callbacks in browser 2015-10-29 17:51:56 +05:30
Robo
62d15953ff remote: track listeners for browser side 2015-10-29 17:51:56 +05:30
Cheng Zhao
a3f62da615 Fix passing Date object in remote
Close #2017.
2015-10-23 14:51:41 +08:00
Cheng Zhao
d5c964c68c Fix passing Error object in remote
Closes #3089
2015-10-23 14:37:28 +08:00
Haojian Wu
9c861b9ad3 Fix always passing the first result to renderer when the API is called multiple
time at once.
2015-10-19 18:07:35 +08:00
Haojian Wu
fb4efec55d Add options check.
This patch avoids main process never response back to renderer if the options is
invalid.
2015-10-19 11:06:56 +08:00
Haojian Wu
214f8477b3 Fix some typos. 2015-10-17 19:28:14 +08:00
Cheng Zhao
d9fdfb711f Clean up CallbackRegistry
There were some ancient code there.
2015-10-16 20:25:30 +08:00
Cheng Zhao
4871ea715c Merge pull request #3103 from bengotow/bengotow/debug-release
Allow "released callback" errors to be traced to remote calls
2015-10-16 20:21:46 +08:00
Cheng Zhao
16b9f8995d Revert "Go back to using node's console.* and std*.write"
This reverts commit 4e8db2c3be.

It seems that we still have problems with Node.js's console.* calls, I'm
reverting this for now unitl we get a solution.

Fixes #3100.
2015-10-16 17:38:11 +08:00
Ben Gotow
aeb24b784d Allow "released callback" errors to be traced to remote calls 2015-10-15 18:46:59 -07:00
Eran Tiktin
4e8db2c3be Go back to using node's console.* and std*.write
It seems that whatever issues we had with using the original
implementation of node for `console.*` calls and for
`process.std*.write` on Windows were solved.
So I removed the patch.

Tested it with cmd, cygwin and used spawn and exec and everything seems
to work (except for colors/ansi escape codes, but that didn't work
before anyway).
2015-10-10 20:17:08 +03:00
Eran Tiktin
c71efc8ca5 Fix process.std*.write
- Support printing Buffer
- Don't add '\n' at the end the chunk
2015-10-10 08:13:27 +03:00
Eran Tiktin
1896deb10e Fix console.* calls on Windows
- Calls for console.* on browser process are printed with no need for
--enable-logging
- The output is without the logging prefix
- The cursor in the terminal is always after the last output
- The first output starts on a new line and not at the prompt
- console.* from renderer are not printed to cmd
- Added a missing '\n' in the default_app help output
2015-10-10 06:39:02 +03:00
Cheng Zhao
9dd714f056 Fix postMessage not working for windows opened by window.open 2015-10-08 10:44:30 +08:00
Haojian Wu
dcb457e76e Refine API design: desktopCapturer.getSources. 2015-10-07 11:10:35 +08:00
Cheng Zhao
927c3f34c3 Guard against undefined, fix #2995
In theory this should never happen, seems like some object is garbage
collected after the JavaScript context has been destroyed.
2015-10-06 22:25:55 +08:00
Haojian Wu
36c0ad7fda Refine more about desktop capturer API.
* Simplify the coffeescript code.
* Add more options in desktopCapturer.startUpdating.
2015-10-05 12:47:01 +08:00
Haojian Wu
1e69ef79de Refine: make desktop-capturer as a renderer module. 2015-10-04 22:04:41 +08:00
Cheng Zhao
01d2765e4b Prevent Node from adding paths outside this app to search paths 2015-10-03 20:38:39 +08:00
Cheng Zhao
9fe326ebeb Clear node's global search paths 2015-10-03 19:55:59 +08:00
Cheng Zhao
1045bbc861 Do not enumerate windows in remote.getCurrentWindow 2015-10-01 14:08:33 +08:00
Cheng Zhao
8c3116851d Exit the process when unable to find a valid app
Fixes #2583.
2015-09-30 17:30:28 +08:00
Cheng Zhao
f2fa0e96eb Pass options in "new-window" event 2015-09-22 23:40:16 +08:00
Cheng Zhao
de41890196 Inherit parent window's options in window.open 2015-09-22 22:32:10 +08:00
Cheng Zhao
f07fea1936 Add allowpopups attribute for webview 2015-09-22 20:11:05 +08:00
Cheng Zhao
f140f35910 Expose experiment APIs 2015-09-14 22:59:49 +08:00
Cheng Zhao
5eb0bedbbc Parse partition in webContents.create 2015-09-06 10:54:34 +08:00
Cheng Zhao
3773f81fd5 Pass partition name instead of path to BrowserContext 2015-09-06 10:53:39 +08:00
Cheng Zhao
9c235509a6 Read guest view's info from WebContentsPreferences 2015-09-06 10:53:03 +08:00
Robo
03ba9533fb store webviewinfo as web contents userdata 2015-09-03 21:27:50 +05:30
Robo
8f59c0b642 create partitionId with encodedURIcomponent 2015-09-03 20:49:29 +05:30
Robo
da5bac42f3 use embedders' browser context when partition is not specified 2015-09-03 20:49:29 +05:30
Robo
d180d3b168 webview: fix partition attribute 2015-09-03 20:49:29 +05:30
Cheng Zhao
50bfe9e335 Set source and origin correctly for window.opener.postMessage 2015-09-01 11:51:10 +08:00
Cheng Zhao
64e8ce0c07 Don't rely on IDWeakMap for bookkeeping remote objects
It frees us from using C++ to track JS objects, thus improves the
performance of collecting memory.
2015-08-27 19:01:34 +08:00
Cheng Zhao
f7c75d36ba Do not create remote object for simple return values of APIs 2015-08-27 16:14:53 +08:00
Cheng Zhao
c441dd1436 Merge pull request #2571 from atom/index-entry-startup
Support index.js module resolution at startup of Electron.
2015-08-26 12:35:24 +08:00
Haojian Wu
7a23add23b Support index.js module resolution at startup of Electron. 2015-08-24 21:16:19 +08:00
Cheng Zhao
33737498ec Make sure guest view is destroyed immediately when embeder is closed 2015-08-24 16:17:15 +08:00
Cheng Zhao
9212a1db8e Merge branch 'master' into chrome44 2015-08-21 19:29:34 +08:00
Eran Tiktin
6f25996fa1 Fixed typo 2015-08-16 23:20:09 +03:00
Cheng Zhao
1f2d7d1cd8 Implement protocol.registerBufferProtocol 2015-08-12 20:37:52 +08:00
Cheng Zhao
d2681d2ba1 Implement protocol.registerFileProtocol 2015-08-12 15:22:19 +08:00