WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 139090
[GTK] Add API to handle beforeunload events
https://bugs.webkit.org/show_bug.cgi?id=139090
Summary
[GTK] Add API to handle beforeunload events
Carlos Garcia Campos
Reported
2014-11-28 05:47:06 PST
beforeunload is fired when a page is about to be closed, to ask the user for confirmation. This happens when reloading a page, when navigation to another page or when the page is closed by a user action (a tab or window closed). In the first two cases, the event is automatically fired by WebCore, but in the case of a user action we need additional API to ensure the event is fired before the page is closed.
Attachments
Patch
(22.90 KB, patch)
2014-11-28 05:59 PST
,
Carlos Garcia Campos
gustavo
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2014-11-28 05:59:57 PST
Created
attachment 242264
[details]
Patch
Michael Catanzaro
Comment 2
2015-01-08 09:56:47 PST
Don't forget to set mnemonics on the buttons: "_Stay on Page" and "_Leave Page" seem good.
Carlos Garcia Campos
Comment 3
2015-10-29 01:51:16 PDT
Ping reviewers. I know this is a so annoying web feature, we can add a setting and disable it by default, so that apps need to explicitly enable it if they really want to irritate their users.
Michael Catanzaro
Comment 4
2015-10-29 05:06:17 PDT
I think, based on the complaints I've heard from users, we should just have it enabled by default. I don't think many sites take advantage of this to create unnecessary "are you sure you want to leave" messages nowadays, except when the departure would cause some form of data loss (e.g. imgur uploads), and the proper solution to that is to add a "prevent this site from showing additional dialogs" button, anyway. Anyway, I don't see anything to improve about the patch. I suspect that apps are not going to use the try_close() API and will wind up not executing the handlers even if they want to, but that's a consequence of the existing API....
Michael Catanzaro
Comment 5
2015-10-29 05:07:36 PDT
(In reply to
comment #4
)
> I think, based on the complaints I've heard from users, we should just have > it enabled by default.
Anyway that doesn't matter for this bug, since you are just adding try_close(); we'll decide how to use it in Epiphany.
Gustavo Noronha (kov)
Comment 6
2015-12-09 03:14:35 PST
Comment on
attachment 242264
[details]
Patch LGTM, pretty straight-forward
Carlos Garcia Campos
Comment 7
2015-12-09 05:33:21 PST
Committed
r193826
: <
http://trac.webkit.org/changeset/193826
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug