Closed GoogleCodeExporter closed 9 years ago
good job~
I use this code to setting global proxy uri::
{{{
import gtk, webkit
import ctypes
libgobject = ctypes.CDLL('/usr/lib/libgobject-2.0.so.0')
libwebkit = ctypes.CDLL('/usr/lib/libsoup-2.4.so.1')
libsoup = ctypes.CDLL('/usr/lib/libsoup-2.4.so.1')
libwebkit = ctypes.CDLL('/usr/lib/libwebkit-1.0.so')
proxy_uri = libsoup.soup_uri_new('http://127.0.0.1:8000')
session = libwebkit.webkit_get_default_session()
libgobject.g_object_set(session, "proxy-uri", proxy_uri, None)
import gtk, webkit; w = gtk.Window() ; s = gtk.ScrolledWindow() ; v =
webkit.WebView() ; s.add(v); w.add(s) ; w.show_all()
v.open('http://www.youtube.com')
}}}
Original comment by jhuangjiahua@gmail.com
on 1 Oct 2010 at 9:48
Original comment by jmalo...@gmail.com
on 22 Oct 2010 at 10:28
Thanks path. Committed in http://goo.gl/Fejc.
Original comment by jmalo...@gmail.com
on 22 Oct 2010 at 11:41
Thanks for the code, jhuangjiahua, it works for me with minor changes in
library filenames. Is there a way to avoid hardcoding these filenames? I'm
afraid I will need to use this code until pywebkitgtk with the new set_proxy
method gets into Debian.
Original comment by t.ce...@gmail.com
on 13 Apr 2011 at 3:52
Is this ever going to get released? Or is pywebkitgtk a dead project? This
issue was patched almost 2 years ago and still not released as far as I can
tell.
Original comment by daen...@gmail.com
on 11 Jun 2012 at 5:50
i used the following code (PyGObject based) without problems in ubuntu 12.04:
from gi.repository import WebKit
from gi.repository import Soup
proxy_uri = Soup.URI.new("http://127.0.0.1:3128")
session = WebKit.get_default_session()
session.set_property("proxy-uri",proxy_uri)
Original comment by stefan.g...@gmail.com
on 14 Jun 2012 at 11:28
That's using some other library. You get this library from "import webkit"
Original comment by daen...@gmail.com
on 14 Jun 2012 at 3:42
Original issue reported on code.google.com by
pathens...@gmail.com
on 31 Aug 2010 at 8:30Attachments: