Skip to content

input.fileDialogOpened + unhandledPromptBehavior:file#883

Merged
sadym-chromium merged 23 commits intomainfrom
sadym/input.fileDialogOpened
Mar 5, 2025
Merged

input.fileDialogOpened + unhandledPromptBehavior:file#883
sadym-chromium merged 23 commits intomainfrom
sadym/input.fileDialogOpened

Conversation

@sadym-chromium
Copy link
Contributor

@sadym-chromium sadym-chromium commented Feb 25, 2025

This PR implements input.fileDialogOpened event and defines unhandledPromptBehavior for file. It should be accompanied by the following changes:
HTML spec: whatwg/html#11030
WebDriver Classic spec: w3c/webdriver#1884
File system access: WICG/file-system-access#452

Open questions:

  1. Should the dialogs be dismissed, or just suppressed in case of user passes "accept" / "ignore"? Current implementation cancels the dialog, which is consistent with other user prompts.
  2. Should the event be merged into browsingContext.userPromptOpened? If so, there will be no way of subscribing only for input.fileDialogOpened event. Also, file dialogs are specific, as it does not support browsingContext.handleUserPrompt.

Re-imagining the #568, addressing #494.


Preview | Diff

Copy link
Contributor

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Copy link
Contributor

@juliandescottes juliandescottes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 2 nits otherwise lgtm

sadym-chromium and others added 2 commits March 5, 2025 15:03
Co-authored-by: Julian Descottes <jdescottes@mozilla.com>
Co-authored-by: Julian Descottes <jdescottes@mozilla.com>
@sadym-chromium sadym-chromium requested a review from gsnedders March 5, 2025 14:07
@sadym-chromium sadym-chromium changed the title Handle file dialogs input.fileDialogOpened + `unhandledPromptBehavior:file Mar 5, 2025
@sadym-chromium sadym-chromium changed the title input.fileDialogOpened + `unhandledPromptBehavior:file input.fileDialogOpened + unhandledPromptBehavior:file Mar 5, 2025
@sadym-chromium sadym-chromium merged commit 3c02257 into main Mar 5, 2025
5 checks passed
@sadym-chromium sadym-chromium deleted the sadym/input.fileDialogOpened branch March 5, 2025 14:12
github-actions bot added a commit that referenced this pull request Mar 5, 2025
SHA: 3c02257
Reason: push, by sadym-chromium

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sadym-chromium
Copy link
Contributor Author

@juliandescottes PTAL on the w3c/webdriver#1884

@whimboo
Copy link
Contributor

whimboo commented Jun 24, 2025

@sadym-chromium when filling out the BiDi status spreadsheet I stumbled over this PR and the question if we actually want to have a input.dismissFileDialog command. There was such one suggested over on #535 but that PR got closed, and I cannot find any other reference.

Given that you already have input.fileDialogOpened implemented in Chrome do you think that we still need such a method? Thanks.

@sadym-chromium
Copy link
Contributor Author

@sadym-chromium when filling out the BiDi status spreadsheet I stumbled over this PR and the question if we actually want to have a input.dismissFileDialog command. There was such one suggested over on #535 but that PR got closed, and I cannot find any other reference.

Given that you already have input.fileDialogOpened implemented in Chrome do you think that we still need such a method? Thanks.

I can be mistaken, but from what I remember, dismissing file dialogs is not possible in some OS. I think current functionality covers all the scenario we are aware of, and we don't need input.dismissFileDialog method.

@whimboo
Copy link
Contributor

whimboo commented Jul 2, 2025

@sadym-chromium when filling out the BiDi status spreadsheet I stumbled over this PR > I can be mistaken, but from what I remember, dismissing file dialogs is not possible in some OS. I think current functionality covers all the scenario we are aware of, and we don't need input.dismissFileDialog method.

Hm, so we basically have the event input.fileDialogOpened, which is emitted when a file dialog is opened. Does it mean that we do not show a real file picker but just a mock? I actually cannot remember anymore what the decision actually was here.

@sadym-chromium
Copy link
Contributor Author

@sadym-chromium when filling out the BiDi status spreadsheet I stumbled over this PR > I can be mistaken, but from what I remember, dismissing file dialogs is not possible in some OS. I think current functionality covers all the scenario we are aware of, and we don't need input.dismissFileDialog method.

Hm, so we basically have the event input.fileDialogOpened, which is emitted when a file dialog is opened. Does it mean that we do not show a real file picker but just a mock? I actually cannot remember anymore what the decision actually was here.

Showing or not the file dialog depends on the "unhandledPromptBehavior:file" capability, and the event is emitted regardless of that.

@whimboo
Copy link
Contributor

whimboo commented Jul 4, 2025

Showing or not the file dialog depends on the "unhandledPromptBehavior:file" capability, and the event is emitted regardless of that.

Lets see where we end-up when we are going to implement the file open dialog support. We will reporter back then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants