Commit graph

58 commits

Author SHA1 Message Date
Christopher Willis-Ford
8fc98e1c37 add new window for privacy policy 2020-10-06 14:34:01 -07:00
Chris Willis-Ford
b05c2c1602
Merge pull request #150 from cwillisf/load-project-from-cli-attempt-2
Support loading project file from command line (attempt 2)
2020-09-29 13:56:30 -07:00
Christopher Willis-Ford
7c6e8a97cc Merge branch 'develop' into redo-rename 2020-09-21 10:46:47 -07:00
Christopher Willis-Ford
05e8b26a34 WIP: actually load project from command line
Doing it this way works for the initial load but overrides later actions
like File -> New.
2020-09-04 13:26:36 -07:00
Christopher Willis-Ford
e2f39580df make command line args available to render process 2020-09-04 12:13:29 -07:00
Christopher Willis-Ford
e9e3f06289 save files more safely (temp then move) 2020-08-25 15:28:58 -07:00
Christopher Willis-Ford
75589099f1 fix MAS file overwrite by deleting existing file
From the code comments:
If the file exists the browser will first download to a temp file then rename to the userChosenPath.
The MAS sandbox allows accessing userChosenPath but not the temp file, so overwriting fails on MAS.
Deleting the file first could be considered risky but works around the sandbox problem.
Security bookmarks might work to fix the problem but they're only supported by async showSaveDialog.
Since we need to use showSaveDialogSync (see WARNING below) this workaround might be the best option.
2020-08-25 14:50:03 -07:00
Chris Willis-Ford
5773d5b17c
Merge pull request #134 from cwillisf/allow-dev-tools-in-release-builds
allow opening dev tools in release builds
2020-08-21 07:40:27 -07:00
Christopher Willis-Ford
d1195c5332 make Scratch Link connections work w/o DNS
This effectively hardcodes `device-manager.scratch.mit.edu` to
`127.0.0.1` within Scratch Desktop.

Note that using "host-rules" instead of "host-resolver-rules" doesn't
work: it results in ERR_CERT_COMMON_NAME_INVALID because the browser
expects Scratch Link's certificate to list "127.0.0.1" as its host name.
Using "host-resolver-rules" means that the IP is used for the connection
only, and not for certificate validation.

See here for more details:
https://www.electronjs.org/docs/api/command-line-switches#--host-rulesrules
https://www.electronjs.org/docs/api/command-line-switches#--host-resolver-rulesrules
2020-08-12 15:54:28 -07:00
Christopher Willis-Ford
c811ade1a2 allow opening dev tools in release builds 2020-08-04 11:00:28 -07:00
Christopher Willis-Ford
8578d60311 Revert "Revert "Merge pull request #131 from cwillisf/rename-to-scratch""
This reverts commit 0817fddce1.
2020-08-04 10:43:27 -07:00
Christopher Willis-Ford
0817fddce1 Revert "Merge pull request #131 from cwillisf/rename-to-scratch"
This reverts commit 71cc32e5bf, reversing
changes made to 43daa269df.
2020-08-04 10:41:32 -07:00
Christopher Willis-Ford
97167537eb rename 'Scratch Desktop' to 'Scratch' / 'the Scratch app' 2020-07-27 11:43:49 -07:00
Christopher Willis-Ford
73a2d3e015 allow reusing render process / fix deprecation warning 2020-05-22 16:16:22 -07:00
Christopher Willis-Ford
229c42469d use minilog for logging, like scratch-gui 2020-05-20 17:05:00 -07:00
Christopher Willis-Ford
5a1526c1e5 update all dependencies, resolve npm audit alerts
minor code changes required for uuid, eslint-config-scratch, and
uglifyjs-webpack-plugin
2020-05-13 14:12:14 -07:00
Christopher Willis-Ford
fdd7a8463f fix makeFullUrl for file:// on Windows 2020-03-30 18:09:03 -07:00
Christopher Willis-Ford
7ee12dcdd8 don't return await 2020-03-17 18:59:07 -07:00
Christopher Willis-Ford
6e1bfc33f3 only call systemPreferences.askForMediaAccess if it exists 2020-03-17 18:55:40 -07:00
Christopher Willis-Ford
74968704c8 improve user experience around mic/camera permission
- ask for permission when trying to use a feature, not on startup
- if permission is denied, explain the consequence and provide a hint
  for fixing it
2020-03-17 18:55:40 -07:00
Christopher Willis-Ford
af73790306 macOS: request camera and microphone access
Note `audio-input` and `camera` were already in `entitlements.plist`

Supporting changes:
- Add `allow-jit` entitlement since documentation says it's needed.
- Only use sandbox for MAS build, not for non-MAS macOS build.
  NOTE: both still use the hardened runtime, as required on Catalina.
- Remove `entitlements.inherit.plist` since it matches default settings.
- Add to `electron-builder.yaml` English descriptions for why the app
  requests access to the microphone and camera. I'm not yet sure if
  there's a way to localize these.
- Minor tweaks in `electron-builder.yaml`.
2020-03-17 18:55:40 -07:00
Christopher Willis-Ford
d1c47e8bd0 work around startup hang in dev on Win10 dark mode
Also, add a few improvements to the way DevTools extensions get
installed.
2020-01-27 14:51:50 -08:00
Christopher Willis-Ford
5f5f24e722 fix unwanted menu bar on Windows 2020-01-16 18:05:53 -08:00
Christopher Willis-Ford
0b6652cde3 fix save & quit dialogs for Electron 6 API changes 2020-01-16 16:28:46 -08:00
Christopher Willis-Ford
9b224115a5 fix infinite load screen introduced with Electron 6 changes 2020-01-16 08:16:23 -08:00
Christopher Willis-Ford
1df51faa95 detect project save based on content type
Also, if saving a file is canceled, only try to cancel project save
telemetry if the save was a project save.

Also also, don't skip showing the save dialog just because a file
doesn't have an extension. Instead, just skip trying to determine
filters for the extension in this case.
2019-09-16 11:23:13 -07:00
apple502j
9ef9d8fce3
Check extension before setting title 2019-09-13 22:29:21 +09:00
Christopher Willis-Ford
d960057260 telemetry: add 'platform' and improve 'version' 2019-08-05 15:46:29 -07:00
Christopher Willis-Ford
740872d14a fix lint problems 2019-08-05 15:39:33 -07:00
Christopher Willis-Ford
232f2f4310 fix "about" window in dev mode 2019-08-05 15:39:33 -07:00
Christopher Willis-Ford
53812d79c7 fix "about" window in packaged context 2019-07-28 18:40:58 -07:00
Christopher Willis-Ford
3cba6fea38 add support for an "about" window 2019-07-28 15:23:38 -07:00
Christopher Willis-Ford
00175f521d set project title from save file name 2019-07-18 14:45:01 -07:00
Christopher Willis-Ford
5b028a1d3d correctly format code metadata in telemetry events 2019-07-17 17:01:10 -07:00
Christopher Willis-Ford
02b06b29a4 fix telemetry init and enforce queue length limit 2019-07-09 13:59:39 -07:00
Christopher Willis-Ford
d93cd7ae33 Remember last save location 2019-01-09 10:41:33 -08:00
Christopher Willis-Ford
1113ba0c18 Support more file types in save dialog override 2019-01-09 10:41:33 -08:00
Christopher Willis-Ford
c0b8752fdc Override 'will-download' event to use native save window 2019-01-09 10:41:20 -08:00
Paul Kaplan
87d9a5e448 Include menu with default keyboard shortcuts to allow mac to work 2018-12-27 13:49:26 -05:00
Christopher Willis-Ford
4848d7548a Add version field to telemetry events 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
22dd1821f4 Supply defaults for telemetry event fields 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
77b8a13d64 Populate telemetry events 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
6486201bf9 Improve appWillClose() reliability 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
64da5dff27 Hook up telemetry opt-in/out modal 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
30cafbf508 Enable telemetry persistence 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
64c2755c70 First draft telemetry client
To do: queue and client ID persistence
2018-12-21 11:31:00 -08:00
Christopher Willis-Ford
6bf5d4a41a Improve main window behavior and code readability
- Closing behavior on Mac is now consistent with other platforms
- The main window is not shown until ready
- Minor code reorg to separate concerns and improve readability
2018-12-14 13:07:24 -08:00
Christopher Willis-Ford
64a06d5b8f Obey scratch-gui's onbeforeunload result
The `scratch-gui` project saver uses `onbeforeunload` to request
confirmation before navigating away from an unsaved project.
Unfortunately Electron suppresses the confirmation dialog that browsers
would normally display. Instead, Electron offers a `will-prevent-unload`
event in the main process: this event fires when `onbeforeunload`
requests a confirmation dialog.

This change adds a handler for `will-prevent-unload` which displays a
quit confirmation dialog so that the overall behavior is similar to what
happens in a regular browser.
2018-12-12 17:10:43 -08:00
Christopher Willis-Ford
4767897f4b only import electron-devtools-installer in dev mode 2018-10-31 15:57:04 -07:00
Christopher Willis-Ford
99b172d893 Add React dev tools 2018-10-13 01:26:58 -07:00