We are assuming that a resource loaded for the main frame that is provisionally loaded is the main resource of the web view. However that's not true for pages loaded from history cache, so when you go back/forward webkit_web_view_get_main_resource() always returns NULL.
Created attachment 152722 [details] Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment on attachment 152722 [details] Patch OK, I'm going to make the obvious naive question. Why is WK lying to us when the page is loaded from the history cache? It does not make sense to try to fix that? (Also, mixing typo fixes with the bug fix, noooo)
(In reply to comment #3) > (From update of attachment 152722 [details]) > OK, I'm going to make the obvious naive question. Why is WK lying to us when the page is loaded from the history cache? It does not make sense to try to fix that? I don't think WK is lying, it's just that pages loaded from the history cache are not provisionally loaded, but go directly to the committed state. I'm not loader expert, though. > (Also, mixing typo fixes with the bug fix, noooo) Oooooook, I'll split the patch :-)
Created attachment 152741 [details] Updated patch Split the patch as suggested by Xan.
Build issue is because it depends on bug #91495
Committed r122960: <http://trac.webkit.org/changeset/122960>