Commit graph

82 commits

Author SHA1 Message Date
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
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
8222b715a7 fix lint from TitledHOC changes 2020-03-17 18:54:56 -07:00
Chris Willis-Ford
85ce509434
Merge pull request #98 from cwillisf/dark-dev-dont-hang
work around startup hang in dev on Win10 dark mode
2020-02-05 12:57:18 -08:00
Christopher Willis-Ford
af029b6937 fix telemetry modal 2020-01-31 16:45:56 -08: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
Ben Wheeler
43f7cd5028 add canEditTitle and projectTitle props 2019-10-28 21:56:37 -04:00
Ben Wheeler
f9e77bc508 ScratchDesktopHOC manages project title, rather than wrapping with TitledHOC 2019-10-25 15:04:09 -04: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
9746fc1dee add content to "about" window 2019-07-28 17:32:14 -07:00
Christopher Willis-Ford
3cba6fea38 add support for an "about" window 2019-07-28 15:23:38 -07:00
Chris Willis-Ford
b452eba142
Merge pull request #60 from cwillisf/show-loading-screen-sooner
Show main window ASAP, even if it's just a loading screen
2019-07-26 23:47:00 -07:00
Christopher Willis-Ford
68bb1f4acc apply Scratch 3.0 color and font styles to loading screen 2019-07-25 18:46:31 -07:00
Christopher Willis-Ford
00175f521d set project title from save file name 2019-07-18 14:45:01 -07:00
Christopher Willis-Ford
f57320e718 Show splash screen ASAP, load render JS async 2019-07-17 17:09:25 -07:00
Christopher Willis-Ford
5b028a1d3d correctly format code metadata in telemetry events 2019-07-17 17:01:10 -07:00
Christopher Willis-Ford
414a1f0cfd move index.js to app.jsx and add new index.js shim
Note that the code inside app.jsx is exactly what used to be in index.js
so this change causes no functional difference and just represents
preparation for upcoming changes. It simplifies at least two upcoming
changes: one wants the app code to be in a different file and the other
is simplified by JSX syntax.
2019-07-17 16:56:56 -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
a7519d167d
Merge pull request #20 from LLK/fix-mac-shortcuts
Include menu with default keyboard shortcuts to allow mac to work
2018-12-27 15:01:38 -05:00
Paul Kaplan
87d9a5e448 Include menu with default keyboard shortcuts to allow mac to work 2018-12-27 13:49:26 -05:00
Ben Wheeler
9c7aceea70 attempt to open _blank link targets in OS's default browser, not electron 2018-12-26 13:59:02 -08:00
Christopher Willis-Ford
4c838c01be Revert "Add last-resort hook to stop link navigation"
This reverts commit c8f6b38df2. It caused
the menus (like File -> Save) not to work.
2018-12-21 12:38:16 -08: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
34d96bf49c Add onProjectTelemetryEvent handler for GUI 2018-12-21 11:31:02 -08:00
Christopher Willis-Ford
77b8a13d64 Populate telemetry events 2018-12-21 11:31:02 -08:00