ZhenxingWu / pywebkitgtk

Automatically exported from code.google.com/p/pywebkitgtk
Other
0 stars 0 forks source link

Patch to allow setting global proxy uri. #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There is an Ubuntu Launchpad ticket complaining about the inability to set the 
Webkit proxy url in recent releases:

 https://bugs.launchpad.net/ubuntu/+source/pywebkitgtk/+bug/424833?comments=all

I've created a patch which adds a "set_proxy" method to webkit/webkitmodule.c. 
I'll submit it to the Ubuntu package maintainer as well. Hopefully this solves 
the problem for some folks.

Original issue reported on code.google.com by pathens...@gmail.com on 31 Aug 2010 at 8:30

Attachments:

GoogleCodeExporter commented 8 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

GoogleCodeExporter commented 8 years ago

Original comment by jmalo...@gmail.com on 22 Oct 2010 at 10:28

GoogleCodeExporter commented 8 years ago
Thanks path. Committed in http://goo.gl/Fejc.

Original comment by jmalo...@gmail.com on 22 Oct 2010 at 11:41

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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