WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: Failed to execute 'showSaveFilePicker' on 'Window

Open leyulin opened this issue 7 months ago • 8 comments

What happened?

Description

I am current have a blazor project. I was invoking window.showSaveFilePicker from interops. However I have to wait a stream fully processed then show this dialog and I have no clue how long the stream will be finished. (depends on the uploaded file size or if multiple files are selected will be a promise chain) Right now a SecurityError dom exception throw after 1-2 sec. It was asking for user activation.

<Line>Failed to execute 'showSaveFilePicker' on 'Window': Must be handling a user gesture to show a file picker.</Line>
<Line>Error: Failed to execute 'showSaveFilePicker' on 'Window': Must be handling a user gesture to show a file picker.</Line>

Investigation

I checked showSaveFilePicker does require Transient user activation. However in my case I have to wait the stream. I can't find a way to overcome this issue.

Question

Is there any possible ways I can bypass that restriction or manually trigger the activation?

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

Other

Operating System

Windows 11

OS Version

No response

Repro steps

See Above

Repros in Edge Browser

Yes, issue can be reproduced in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

leyulin avatar Jul 18 '24 03:07 leyulin