[webkit-gtk] Support clearing history

Igor Korot ikorot01 at gmail.com
Sun Nov 26 10:57:52 PST 2017


On Sun, Nov 26, 2017 at 11:11 AM, Michael Catanzaro
<mcatanzaro at igalia.com> wrote:
> On Sat, Nov 25, 2017 at 10:49 PM, Igor Korot <ikorot01 at gmail.com> wrote:
>> Hi, Michael,
>> I'm talking about this function that was not ported to WebKit2:
>> https://webkitgtk.org/reference/webkitgtk/stable/WebKitWebBackForwardList.html#webkit-web-back-forward-list-clear.
> Yeah, that function is not available because the back/forward list is
> read-only now.

Yes, I kind of get that. ;-)

>> I think it is basic Web Engine functionality to clear the history/cookies.
>> And it might be a security requirements.
> (Of course, this has nothing to do with cookies. You can use
> WebKitWebsiteDataManager to clear those.)
> Clearing the history of the back/forward list is a security requirement?
> What is your use-case for this; what are you really trying to do? The
> back/forward list is transient session state that goes away when you destroy
> the web view. It's not persistent (unless you deliberately save and restore
> it using WebKitWebViewSessionState) and it's not tied in any way to the
> actual history functionality of web browsers that use WebKit.
> To allow clearing the back/forward list, you'd have to convince Brady that
> it's a good idea (bug #69358 comment #5) and that will probably be
> difficult, especially because Safari does not need the feature....
>> Are there another way to clear the history in the WebKit2GTK realm?
> It goes away when you destroy the WebKitWebView. So in theory, you could
> destroy the current WebKitWebView, remove it from its parent
> (gtk_container_remove), create a new one, then gtk_container_add() and
> gtk_container_show(). I think that would work, at the cost that you'd have
> to reload the current page. But I'm not sure why you'd want to do that.

Do you mean history or the BackForwardList?
Because if you are talking about the browsing history cleanup - this is ugly
solution. Why should I destroy the view (browser) just to clear browsing

Is there another sane solution?

Both FF and IE have an ability to clear the browsing history and I
doubt they are destroying
anything when they do it.

Thank you.

P.S.: Sorry for not sending it to the list. As I said - I tried to do
an inline reply and
gmail didn't allow it for some reason.

> Michael
> (P.S. You might get more responses if you CCed the mailing list!)

More information about the webkit-gtk mailing list