Commit graph

133 commits

Author SHA1 Message Date
Samuel Attard
abf2e9c93d
chore: expose electrons built in modules in the REPL along with nodes (#24249) 2020-06-24 00:53:46 -07:00
Shelley Vohr
4c77fe318d
refactor: improve the REPL (#24204)
This PR improves the Electron REPL experience. It adds a welcome message to the REPL to let users know what versions of Node.js and Electron they're running, as well as overriding the completer function in the REPL to preload and add tab autocompletion for Electron's own modules.
2020-06-22 19:03:19 -07:00
Milan Burda
0629c6c2ea
fix: isTrustedSender() in test-app (#24214) 2020-06-22 14:14:20 +02:00
Samuel Attard
5d657dece4
build: enable JS semicolons (#22783) 2020-03-20 13:28:31 -07:00
Samuel Attard
cd5e3901de
chore: fix default_app dimensions (#22675) 2020-03-16 15:28:34 +09:00
Samuel Attard
0090616f7b
feat: add a new contextBridge module (#20307)
* feat: add a new contextBridge module

* chore: fix docs linting

* feat: add support for function arguments being proxied

* chore: ensure that contextBridge can only be used when contextIsolation is enabled

* docs: getReverseBinding can be null

* docs: fix broken links in md file

* feat: add support for promises in function parameters

* fix: linting failure for explicit constructor

* Update atom_api_context_bridge.cc

* chore: update docs and API design as per feedback

* refactor: remove reverse bindings and handle GC'able functions across the bridge

* chore: only expose debugGC in testing builds

* fix: do not proxy promises as objects

* spec: add complete spec coverage for contextBridge

* spec: add tests for null/undefined and the anti-overwrite logic

* chore: fix linting

* spec: add complex nested back-and-forth function calling

* fix: expose contextBridge in sandboxed renderers

* refactor: improve security of default_app using the new contextBridge module

* s/bindAPIInMainWorld/exposeInMainWorld

* chore: sorry for this commit, its a big one, I fixed like everything and refactored a lot

* chore: remove PassedValueCache as it is unused now

Values transferred from context A to context B are now cachde in the RenderFramePersistenceStore

* chore: move to anonymous namespace

* refactor: remove PassValueToOtherContextWithCache

* chore: remove commented unused code blocks

* chore: remove .only

* chore: remote commented code

* refactor: extract RenderFramePersistenceStore

* spec: ensure it works with numbered keys

* fix: handle number keys correctly

* fix: sort out the linter

* spec: update default_app asar spec for removed file

* refactor: change signatures to return v8 objects directly rather than the mate dictionary handle

* refactor: use the v8 serializer to support cloneable buffers and other object types

* chore: fix linting

* fix: handle hash collisions with a linked list in the map

* fix: enforce a recursion limit on the context bridge

* chore: fix linting

* chore: remove TODO

* chore: adapt for PR feedback

* chore: remove .only

* chore: clean up docs and clean up the proxy map when objects are released

* chore: ensure we cache object values that are cloned through the V8 serializer
2019-10-18 12:57:09 -07:00
Milan Burda
79f0c444fd fix: app.getAppPath() returning default-app path for files or directories without package.json (#18763) 2019-06-19 23:34:22 +02:00
Milan Burda
69e32ad9ce refactor: use ipcRenderer.invoke / ipcMain.handle in default-app (#18581) 2019-06-04 18:13:35 +02:00
Samuel Attard
913bd4c832
fix: correctly parse default_app path on windows (#18086) 2019-05-01 13:00:09 -07:00
Shelley Vohr
8d83518f9a
refactor: make name a prop on app (#17701)
Update app.name to be a property on app.
2019-04-30 13:55:33 -07:00
Milan Burda
f7a38ec72a fix: permission handler regression in default app (#17927) 2019-04-24 09:54:53 -07:00
Samuel Attard
b7b9efa875
fix: handle remote-debugging-port=0 correctly (#17800)
By default the Chromedriver will send remote-debugging-port=0 to let the
browser choose a free port to listen on.  The chosen port is written to
a known file in the user data dir that is passed to the app through the
CLI.

This PR does two things.

1. Correctly passes the USER_DATA_DIR to the remote debugging server so
it knows where to write the file
2. Adds support for --user-data-dir as we did not support that CLI
argument and Chromedriver relies on being able to tell the "browser"
where to write this file.

Fixes #17354
2019-04-16 14:22:51 -04:00
Shelley Vohr
5eb75e91b9
chore: fix default_app showMessageBox (#17357) 2019-03-12 14:10:18 -07:00
Milan Burda
a8698d092b chore: increase security of default_app (#17318) 2019-03-11 16:13:46 -07:00
Felix Rieseberg
5581990d78 build: Update TypeScript, use @typescript-eslint (#17251)
* build: Update TypeScript to v3.3

* build: Update TypeScript, use @typescript-eslint
2019-03-07 12:56:02 -08:00
Samuel Attard
26df9992cf
build: use typescript for internal Electron JS code (#16441) 2019-02-06 10:27:20 -08:00
Samuel Attard
b202ad1e24
refactor: remove js2asar.py and port logic to JS in more readable / GN-style way (#16718)
* refactor: remove js2asar.py and port logic to JS in more readable / GN-style way

* refactor: further clean up ASAR impl, add new node_action GN template
2019-02-05 12:10:15 -08:00
Milan Burda
23d44e322d feat: use default-app behavior in packaged apps (#16310)
Unify the behavior between default app and packaged apps:
- create default application menu unless the app has one
- default window-all-closed handling unless the app handles the event
2019-01-15 21:35:53 +01:00
Shelley Vohr
0881fd6397
feat: split openExternal into sync and async (#16176)
* feat: split openExternal into sync and async

* v8::Locker => mate::Locker

* fix: enter js env when resolving promise
2019-01-14 20:35:21 -08:00
Milan Burda
102d8fe506 chore: add 'use strict' to default app sources (#16346) 2019-01-10 20:54:34 +01:00
Milan Burda
eb02a422de feat: add fileMenu / viewMenu / appMenu roles (#16328) 2019-01-10 14:32:03 +01:00
Milan Burda
fade3eb679 chore: make "nodeIntegration" and "webviewTag" default to false (#16235) 2019-01-07 22:19:27 +03:00
Shelley Vohr
a1a431eb87
fix: make windowMenu role correct on MacOS (#15930) 2018-12-03 11:52:46 -08:00
Shelley Vohr
9fd98bb27b
refactor: no longer require submenu for services menuitem (#15656) 2018-11-10 12:47:55 -05:00
Jeremy Apthorp
98829aa916 fix default_app.js calling no-longer-existent API 2018-10-09 14:38:00 -07:00
Shelley Vohr
47258f7b3d
fix: default_app incorrect loading by url (#14940) 2018-10-03 08:10:22 -07:00
Samuel Attard
0d2a0c7583 feat: add APIs to support mojave dark modes (#14755)
* feat: add APIs to support mojave dark mode

Closes #13387

* docs: fix system-prefs typo
2018-09-27 10:33:31 -05:00
Samuel Attard
32a9df2940
refactor: clean up the default app implementation (#14719)
* Disable nodeIntegration
* Enable contextIsolation
* Re-implement the CSP security check to handle running in
contextIsolation
* Disable bad DCHECKS for the promise helper
* Remove the unused "-d" flag for the electron binary
* Added a way to hide the default help output for electron devs who
don't want to see it every time
2018-09-21 15:24:42 +10:00
Samuel Attard
558fff69e7
chore: update to standard 12 2018-09-14 14:57:01 +10:00
Samuel Attard
1b7418fb7b
Revert "sec: deprecate some webPreference defaults to be secure-by-default (#14284)" (#14380)
This reverts commit 66d6ba8689.
2018-08-30 09:57:49 +12:00
Samuel Attard
66d6ba8689 sec: deprecate some webPreference defaults to be secure-by-default (#14284)
* feat: deprecate default value of nodeIntegration

* Use DeprecationStatus::Stable as the default instead of shadowing

* change wording of deprecations

* chore: also deprecate kWebviewTag and kContextIsolation

* chore: do as we preach, lets be secure-by-default in the default app
2018-08-29 13:14:04 -05:00
Milan Burda
c8030a0f2a feat: support chrome:// URLs in default_app (#13575) 2018-07-17 17:23:44 +10:00
Samuel Attard
12fcac59a2
refactor: clean up the default app, add CSP (#13437)
* refactor: clean up the default app, add CSP

* chore: appease the linter

* refactor: make js2asar more generic, dont assume default_app as target
2018-07-17 10:26:58 +10:00
simurai
0f54e56389 Replace default_app icon 2017-12-07 16:10:45 -05:00
Felix Rieseberg
f81bfb7b86 🔧 Fix style issues 2017-11-23 13:42:48 -08:00
Ronald Eddy
14c6e78147 Update electron.atom.io -> electronjs.org
Update electron.atom.io -> electronjs.org to reduce redirects and speed navigation.
2017-11-19 04:01:33 -08:00
Felix Rieseberg
ae960027f2 🔧 Bring back —abi 2017-11-10 14:58:21 -08:00
Felix Rieseberg
c38f66cc1b 🔧 Ensure that -r isn’t considered interactive 2017-10-24 17:00:42 -07:00
Shelley Vohr
bedb8ca191
remove potential deprecation and fix app close 2017-10-07 01:03:54 -04:00
Shelley Vohr
a45b1625fc
remove newline and add deprecation warning 2017-10-06 23:29:54 -04:00
Zeke Sikelianos
e8ec1a6ed4 add utm source to outbound links 2017-09-29 12:31:17 -07:00
Zeke Sikelianos
bf2b6b3ac4 fix link behavior 2017-09-29 12:26:03 -07:00
Zeke Sikelianos
56581b416d improve command prompt styles 2017-09-29 12:13:31 -07:00
Zeke Sikelianos
a2f178b664 fix octicon alignment 2017-09-29 12:03:28 -07:00
Zeke Sikelianos
01ca3ae07f make nav link text clickable 2017-09-29 12:03:12 -07:00
Zeke Sikelianos
cc6803b358 remove unused styles 2017-09-29 11:35:39 -07:00
Zeke Sikelianos
33394f76d4 make styles more consistent with website 2017-09-29 11:35:22 -07:00
Zeke Sikelianos
f0048d54b0 make it roomy 2017-09-29 11:34:48 -07:00
Zeke Sikelianos
9db9ffd3e4 chrome -> chromium 2017-09-29 10:41:48 -07:00
Zeke Sikelianos
0ca53420d5 use relative path to electron 2017-09-29 10:41:20 -07:00