-
Notifications
You must be signed in to change notification settings - Fork 692
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: register-local-version protocol command #1652
base: main
Are you sure you want to change the base?
feat: register-local-version protocol command #1652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really elegant implementation!
Co-authored-by: Erick Zhao <erick@hotmail.ca>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a confirmation dialog similar to the one we show when we load Fiddles from the docs.
fiddle/src/renderer/remote-loader.ts
Lines 251 to 261 in 3452e12
/** | |
* Verifies from the user that we should be loading this fiddle. | |
* | |
* @param what - What are we loading from (gist, example, etc.) | |
*/ | |
public verifyRemoteLoad(what: string): Promise<boolean> { | |
return this.appState.showConfirmDialog({ | |
label: `Are you sure you want to load this ${what}? Only load and run it if you trust the source.`, | |
ok: 'Load', | |
}); | |
} |
I'm also a bit weary from a security perspective to expose modifying Fiddle's list of local builds like this. I think it warrants stronger consideration of how it might be abused.
When multiple dialogs are requested to be shown, they now wait for the previous dialog to be closed and cleaned up.
@dsanders11 I've added a confirmation dialog. While testing I noticed that multiple requests will clobber the previous dialog. I've gone ahead and added a fix for that as well. Screen.Recording.2024-11-22.at.7.15.33.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be a protocol URL that can in theory be triggered by remote pages, make it a CLI argument to the fiddle binary instead and have build tools spawn fiddle, trigger the second instance event and handle that.
Also fiddle that confirm with the user they actually want to register this thing before it just Does What It Was Told
I feel like this gets exceedingly difficult when there are multiple installations or apps installed outside of the default directory (especially on Windows).
Added in the most recent commit. |
Implements protocol handler for
electron-fiddle://register-local-version/
to allow registering local versions.Example request:
This is intended to be used by build-tools as a way to quickly download build artifacts and test them in Fiddle.
Screen.Recording.2024-11-21.at.7.24.22.PM.mov