Bug 270074 - cog: Segmentation fault on trying to show a file open dialog
Summary: cog: Segmentation fault on trying to show a file open dialog
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-26 02:05 PST by marcus.marold
Modified: 2024-03-12 00:20 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marcus.marold 2024-02-26 02:05:01 PST
Hello, we're testing the "WPE WebKit for Mir Kiosk" snap and encountered an issue on clicking on a web site having a button which shows a file input dialog. This seems to be not supported by the used WPEWebKit browser running in Kiosk mode. Is there any option to prevent the browser from crashing? We would expect all IO dialogs to be not shown, because of security reasons.
What is the default behavior of file input & file save dialogs here?

109978 Segmentation fault "$SNAP"/usr/bin/cog "${cog_params[@]}" "$url"

This is the JavaScript code trying to show the input element:

showFileinputDialog(): void {
const e = document.getElementById('idFileInput');
const event = new MouseEvent('click', { bubbles: false });
e.dispatchEvent(event);
}
Comment 1 Michael Catanzaro 2024-02-26 09:17:51 PST
You'll want to handle the WebKitWebView::run-file-chooser signal and return TRUE to stop the file chooser from being opened.

Regarding the crash, please post a stack trace, following the instructions at https://handbook.gnome.org/issues/stack-traces.html (although these instructions don't cover snap; hopefully snap has some tool or instructions for how to get a backtrace)
Comment 2 marcus.marold 2024-03-12 00:20:08 PDT
We can't reproduce the issue with official WPE WebKit 2.42.5 and it's stable tagged components mentioned here: https://wpewebkit.org/release/

You can close this.