[Sugar-devel] [PATCH v2 Browse] Fix for the MIME type handling of a request SL #3512

Manuel Kaufmann humitos at gmail.com
Thu May 3 22:30:21 EDT 2012


On Wed, May 2, 2012 at 1:07 PM, Manuel Quiñones <manuq at laptop.org> wrote:
>             self.emit('open-pdf', request.get_uri())
> -            return False

Reading the WebKit documentation [1] I found that we HAVE TO return
True if we are handling the MIME type ourselves. In fact, we have to
open a new tab (as we are doing now) and ignore the request for the
original tab. There is a way to do this ignoring the request[2] in
that tab using:

policy_decision.ignore()

So, you should replace the "return False" by "return True" and put
"policy_decision.ignore()" immediately after emitting the 'open-pdf'
signal. I've just tested this and it works.

That's all! Thanks for your patch!

[1] http://webkitgtk.org/reference/webkitgtk/unstable/webkitgtk-webkitwebview.html#WebKitWebView-mime-type-policy-decision-requested
[2] http://webkitgtk.org/reference/webkitgtk/unstable/WebKitWebPolicyDecision.html#webkit-web-policy-decision-ignore

-- 
Kaufmann Manuel
Blog: http://humitos.wordpress.com/
Porfolio: http://fotos.mkaufmann.com.ar/
PyAr: http://www.python.com.ar/


More information about the Sugar-devel mailing list