GNOME Bugzilla – Bug 788899
Restore EphyWindow's navigation action decide-policy handling
Last modified: 2017-10-24 17:28:45 UTC
The safe browsing feature has effectively disabled other modules' handling of decide-policy by always handling navigation action to allow async verification to happen. We should bypass the verification and trigger the signal again after the verification is done, allowing other handlers to run.
Created attachment 361453 [details] [review] Restore EphyWindow's navigation action decide-policy handling The safe browsing feature has effectively disabled other modules' handling of decide-policy by always handling navigation action to allow async verification to happen. We now bypass the verification and trigger the signal again after the verification is done, allowing other handlers to run.
Review of attachment 361453 [details] [review]: Well crap. :) That's an unfortunate regression. ::: embed/ephy-web-view.c @@ +1325,3 @@ + */ + data->web_view->bypass_gsb_verification = TRUE; + g_signal_emit_by_name (data->web_view, "decide-policy", Hm, I think we need to find a better way, without depending on the order that the signal handlers get connected, and without re-emitting the signal. One option would be to just get rid of the EphyWebView handler and merge it into the EphyWindow handler. This is probably what we'll need to do. Another would be to experiment with the order that the signal handlers run in. You could switch the EphyWebView handler to using g_signal_connect_after(), for instance. Alternatively (and probably better) you could assign a virtual implementation in class_init instead of using g_signal_connect(). Either way should cause the EphyWindow handler to run first. The likely problem with this approach is that handling the policy decision in the EphyWindow handler would cause the safe browsing check to be skipped, which could be unexpected, so it might be better to just merge everything into the EphyWindow handler. Another problem is the if (navigation_type == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED) case in the EphyWindowHandler, which in the general case always calls loads the request manually with ephy_web_view_load_request() and then calls webkit_policy_decision_ignore(). We don't want that to cause the safe browsing check to be skipped.
Created attachment 361812 [details] [review] Move safe browsing verification from EphyWebView to EphyWindow
Review of attachment 361812 [details] [review]: This seems better, thanks. And thanks to Gustavo for the debugging. ::: embed/ephy-web-view.c @@ +3027,3 @@ +gboolean +ephy_web_view_get_bypass_safe_browsing (EphyWebView *view) Let's name it "get_should_bypass_safe_browsing" @@ +3035,3 @@ + +void +ephy_web_view_set_bypass_safe_browsing (EphyWebView *view, set_should_bypass_safe_browsing
Created attachment 361822 [details] [review] Move safe browsing verification from EphyWebView to EphyWindow
Comment on attachment 361822 [details] [review] Move safe browsing verification from EphyWebView to EphyWindow Attachment 361822 [details] pushed as 22c6aec - Move safe browsing verification from EphyWebView to EphyWindow
Thanks for looking into this =)