-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat]: Add option to disable "Show Local" while saving #5118
Comments
Interesting! So this gives you access to the files on the local machine? I don't think we realized that. This is an interesting feature request though. |
Yes, it opens an explorer/finder popup asking where to save the file locally. After that the file gets downloaded. This button |
yeah it's a bit pointless removing file download but having this option, i would say --disable-file-downloads and --disable-show-local option should go hand in hand - also there is security issues with uploads too the way there are issues / code / ip leaks with downloads.. |
I've traced through the code and I believe the place to address this is within this function: addFileSchemaIfNeeded function in fileDialogService.ts Specifically, my understanding is that if the To @avsthiago-kbc comment above, this function is used in several places and would require passing a context variable to clarify whether the context is `save' or 'open'. I have pulled together some working code for this, but one of my biggest confusion points is around the appropriate way to propagate the disable-file-downloads option down to this location in the code. Initially I was trying to follow the way this was done in the patch that introduced the flag, but it was making use of ContextKeys and using those in if-then statements didn't seem correct. I ended up using the environmentService variable that was already on abstractFileDialogService, but I had to change it from IWorkbenchEnvironmentService to IBrowserWorkbenchEnvironmentService. I noticed that this same change was made in src/vs/workbench/browser/contextkeys.ts in the PR to add the disable-downloads flag but I don't fully understand the ramifications. |
In code-server that will always be an |
I just created a PR for this. I initially took the approach that I discussed in my above comment to control the contents of |
What is your suggestion?
Reuse the option
--disable-file-downloads
recently implemented on #5055 to remove theShow Local
button when using theSave As
option. This option allows the users to save the current file on their local machine.Example:
Why do you want this feature?
One could argue that having the option to save the file locally makes the download as accessible as having the
Download
button when right clicking the file name. As mentioned in the comments on the issue #1386, some industries have concerns about downloading files from the IDE.Are there any workarounds to get this functionality today?
Not that I'm aware of.
How this feature could be implemented?
We could extend the code implemented on #5055. The value of the option
--disable-file-downloads
could be used within a condition that will either add the "Show Local" button or not. As I understand, the button is added on simpleFileDialog.ts L279. Disclaimer, I'm not familiar with the code base, neither TypeScript, so there might be more places we will need patch.Are you interested in submitting a PR for this?
Yes, but I might need some guidance setting up the environment.
The text was updated successfully, but these errors were encountered: