Commit graph

71 commits

Author SHA1 Message Date
michtsu
392458b252 Add devtools API to inspect shared worker. (#16615) 2019-02-01 10:44:24 -08:00
Anrock
9ff7807be8 fix: move window.open handlers from BrowserWindow to WebContents 2018-11-27 10:59:01 +09:00
Shelley Vohr
c06f023313
feat: allow partial setting of window bounds (#15677)
Extend the existing win.setBounds functionality by allowing developers to partially update bounds without being forced to pass in all four bounds values. No existing functionality is altere
2018-11-12 15:31:14 -05:00
Cheng Zhao
cb9be091aa refactor: remove potential double free when managing WebContents (#15280)
* refactor: remove -new-contents-created event

Chromium expects us to take ownership of WebContents in AddNewContents,
we should not create V8 wrapper in WebContentsCreated, otherwise we
would have WebContents being managed by 2 unique_ptr at the same time.

* refactor: make CreateAndTake take unique_ptr
2018-10-22 13:02:25 -05:00
Andy Dill
37f2113032 feat: expose setBackgroundThrottling api (#15104) 2018-10-19 11:32:22 +11:00
Milan Burda
b50f86ef43 refactor: use separate ipc-renderer-internal / ipc-main-internal APIs for Electron internals (#13940) 2018-10-07 00:48:00 +13:00
Milan Burda
3ad3ade828 refactor: add prefer-const to .eslintrc + fix errors (#14880) 2018-10-02 11:56:31 +10:00
Samuel Attard
558fff69e7
chore: update to standard 12 2018-09-14 14:57:01 +10:00
Milan Burda
58577bd431 feat: add options to webContents.loadFile (#14515) 2018-09-11 17:56:49 +10:00
Cheng Zhao
bb2715e7a5 feat: add TopLevelWindow.setContentView API 2018-05-15 14:12:47 +09:00
Cheng Zhao
1340b17424 Do not return TopLevelWindow in BrowserWindow.getAllWindows 2018-04-19 13:08:37 +09:00
Cheng Zhao
e38f511737 Make BrowserWindow inheirt TopLevelWindow in JS 2018-04-19 13:08:37 +09:00
Nitish Sakhawalkar
970f79e32f Check for devtools in BrowserWindow.getFocusedWindow() (#12526) 2018-04-06 09:21:32 -04:00
Jeremy Apthorp
f0d08f4da1 Propagate referrer to new windows (#12397)
* Propagate referrer to new windows

Fixes #9205

* Rearrange -new-window event arguments for backwards-compatibility

* Plumb referrer policy through guest-window-manager

* Document the Referrer structure and its uses

* Add tests for referrer in new windows

* Docs nits
2018-04-05 18:13:24 -05:00
Samuel Attard
1553b54779
Add window.loadFile and webContents.loadFile helper methods 2018-01-04 11:38:56 +13:00
Felix Rieseberg
7630ac6e90 🔧 Return null if not found 2017-11-22 15:48:11 -08:00
Felix Rieseberg
8c5aad8b17 🔧 Add BrowserWindow.fromBrowserView() 2017-11-22 14:36:54 -08: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
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
7baf472c0f Implement BrowserPluginGuestDelegate::CreateNewGuestWindow for nativeWindowOpen 2017-05-26 10:10:36 -07:00
deepak1556
5e976be43b remove page-title-updated workaround for #3380 2017-05-01 16:53:55 +09:00
Kevin Sawicki
f9dd91d54d Add static helper to bind touch bar to window 2017-03-03 14:00:39 -08:00
Kevin Sawicki
51f1c5a557 Use SetTouchBar withe empty vector instead of DestroyTouchBar 2017-03-03 14:00:39 -08:00
Kevin Sawicki
d5dbe3676e Add window helpers to TouchBar class 2017-03-03 14:00:39 -08:00
Kevin Sawicki
98f5858b11 Initial support for dynamic properties 2017-03-03 14:00:38 -08:00
Kevin Sawicki
cbb6f8c33e Store event listeners in each TouchBar class 2017-03-03 14:00:38 -08:00
Kevin Sawicki
eff49ad19c Return early when touchBar is null 2017-03-03 14:00:38 -08:00
Kevin Sawicki
9bdca3bbfb Remove linter warnings 2017-03-03 14:00:38 -08:00
Samuel Attard
dd09c91cf2 initial work on updating touch bar item config without rerender 2017-03-03 14:00:38 -08:00
Samuel Attard
4f0caffc3b Fix JS linting 2017-03-03 14:00:38 -08:00
Samuel Attard
c92c4138a8 Add Slider item type and add options to the button type 2017-03-03 14:00:38 -08:00
Samuel Attard
7857c83ea1 Make dynamic buttons work along with click events 2017-03-03 14:00:38 -08:00
Kevin Sawicki
1d84d83fd4 Forward webview visibility change events from browser process 2017-02-28 08:23:00 -08:00
Kevin Sawicki
de4be56b09 Use internal open event name with fully parsed options 2017-01-16 12:38:16 -08:00
Kevin Sawicki
820fb3b82b Guard against no devtools web contents 2016-12-06 10:36:59 -08:00
Kevin Sawicki
c8ff67ab75 Use spread syntax instead of function apply 2016-12-01 14:56:00 -08:00
deepak1556
0410a184ce webContents: handle POST navigation for new windows 2016-11-11 10:53:00 -08:00
Michael Vasseur
c811188e22 Updated required code to handle missing additional features for popup windows 2016-10-04 14:38:32 +09: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
Kevin Sawicki
f7b72f0948 Move capturePage to WebContents 2016-07-06 09:21:28 -07:00
Cheng Zhao
1104dded24 Handle multiple modal windows correctly 2016-06-20 11:16:41 +09:00
Cheng Zhao
3f34f80433 Add win.setModal(modal) API 2016-06-20 11:16:41 +09:00
Leonard Lamprecht
67dd19ed0f Replace OS X and Mac OS with macOS 2016-06-18 15:26:26 +02:00
Kevin Sawicki
70996c79ba Add showDefinitionForSelection webContents proxy method 2016-06-08 10:19:43 -07:00
Kevin Sawicki
cc7395eea8 Remove returns from event listeners 2016-05-19 15:28:08 -07:00
Steve Kinney
fd9c9c3be7 💄 Use spread operator instead of arguments object 2016-05-14 22:33:21 -04:00
Steve Kinney
236810a923 💄 Use ES6; clean up CoffeeScript conversion
💄 Destructure app module

Address linting errors
2016-05-14 22:33:20 -04:00
Kevin Sawicki
7685380105 Remove crashed event forwarding 2016-05-06 10:12:56 -07:00
Kevin Sawicki
56cd57872c Remove BrowserWindow events now on WebContents 2016-05-06 10:12:56 -07:00
Kevin Sawicki
6f0471f6cb Remove deprecated options check in BrowserWindow 2016-05-06 10:12:53 -07:00