Coder Social home page Coder Social logo

pywebkitgtk's Introduction

Python WebKit GTK+
----

The PyWebKitGtk project aims to provide Python bindings to the GTK+ port of
WebKit, an open-source web browser engine that powers numerous applications
such as web browsers, email clients, feed readers, web and text editors, and a
whole lot more[1]


Project Goals
----

The project share the same goals with WebKit[2]. The purpose of this binding
is to bring an alternative web engine to Python/GTK+ application developers who
might need a web browser engine for their next application or developers
wishing to have a better browser engine that they can access to using the
Python programming language.

Happy Hacking!


Contact
----

Web:            http://code.google.com/p/pywebkitgtk

Source (Git):   http://repo.or.cz/w/pywebkitgtk.git

Source (SVN):   http://code.google.com/p/pywebkitgtk/source


References
----

[1] Applications that use WebKit 
    http://trac.webkit.org/projects/webkit/wiki/Applications%20using%20WebKit

[2] WebKit Goals
    http://webkit.org/projects/goals.html

[3] WebKit Bugzilla
    http://bugs.webkit.org


Resources
----

 * GNOME Desktop
   http://www.gnome.org

 * GTK+
   http://www.gtk.org

 * Python
   http://www.python.org

 * WebKit
   http://www.webkit.org

pywebkitgtk's People

Watchers

James Cloos avatar

pywebkitgtk's Issues

fails to build from source for webkit/gtk in ubuntu 8.04

Based on conversation from djinn, seems that we might need to branch for
webkit/gtk packaged in ubuntu 8.04 too.

21:57 < djinn> ‘WebKitWebBackForwardList’ undeclared
21:57 < djinn> ‘WebKitWebHistoryItem’ undeclared
21:58 < djinn> webkit ver 1.0
21:58 < djinn> pywebkit 1.0.1



Original issue reported on code.google.com by [email protected] on 22 Sep 2008 at 12:03

[PATCH] libtool-2.2 compatibility

I'm attaching a patch which is necessary for building pywebkitgtk with
libtool-2.2.  Similar patches are being added for other PyGTK bindings as
well: 

http://bugzilla.gnome.org/show_bug.cgi?id=564018
http://bugzilla.gnome.org/show_bug.cgi?id=564023
http://bugzilla.gnome.org/show_bug.cgi?id=564545


Original issue reported on code.google.com by [email protected] on 30 Mar 2009 at 2:45

Attachments:

Undefined symbol

Trying to import pywebkitgtk gives this error:

>>> from webkit import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python2.6/site-packages/gtk-2.0/webkit.so: undefined
symbol: webkit_web_view_set_window_features

WebkitGtk version: 1.0.3
pywebkitgtk version: latest svn
Operating system: Arch Linux

Original issue reported on code.google.com by [email protected] on 6 Jan 2009 at 1:22

unmark_text_matches missing API

The API is missing to unmark text matches, which makes it difficult to do
nice cumulative search bar.

This is the bindable function:

void webkit_web_view_unmark_text_matches(WebKitWebView* webView)

Original issue reported on code.google.com by [email protected] on 16 Nov 2008 at 6:41

API tests

We need API tests to make sure we're not breaking anything or upstream WebKit 
do not break 
anything for that matter.

Original issue reported on code.google.com by [email protected] on 4 Aug 2008 at 1:35

Access DOM from pywebkitgtk

Hello pywebkitgtk world,
I am trying to get started with the Python binding for the WebKit GTK+ port
but I am having some difficulties with accessing the DOM model from
pywebkitgtk.
I would really appreciate any help.

I have installed pywebkitgtk-1.1.4 and WebKit-r42583 (got a nightly build from
http://nightly.webkit.org/) on my Fedora 10 Linux machine.

I can run the demo tabbed_browser.py without any issues.
So, I suppose the installation was successful.
But how can I access DOM?

I have visited the following URLs (among many others..)
https://bugs.webkit.org/show_bug.cgi?id=16401 (1)
http://code.google.com/p/pywebkitgtk/issues/detail?id=13 (2)  and
http://mail.gnome.org/archives/gtk-devel-list/2008-December/msg00122.html (3)

but it is not clear to me what I should do in order to access the DOM tree of
a page rendered inside the embedded browser window.

Should I apply any patches since I have the latest versions of pywebkitgtk
and WebKit (as of March 2009)?
If yes, could please somebody provide any instructions about how to do
that? How can somebody
apply the attached "f" (or "psd"?) patch file provided in (2) [Issue 13:
add bindings to DOM model]?

I came across the Pyjamas and Pyjamas-Desktop projects but I haven't
figured out whether
it is necessary to install one of them so as to "get_gdom_document" of the
main frame (WebFrame object)..

Doesn't the latest WebKit release provide the "webkit-glib-gtk" package
(mentioned in (3))
that provides gobject bindings to webkit's DOM model??

Apparently, I am quite confused..

I hope I am not tiring or annoying you with my questions..

Thank you very much in advance for your time and help..
Kind regards

Original issue reported on code.google.com by [email protected] on 20 Apr 2009 at 7:45

Non-portable use of python-config

pywebkitgtk-1.1.5 determines the -I flags for python via:

dnl check for python
AM_PATH_PYTHON(2.4)
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
AC_MSG_CHECKING([for pythons include path])
PYTHON_INCLUDES=`python-config --includes`
AC_MSG_RESULT($PYTHON_INCLUDES)

Three bugs in the last two lines:
1. AM_PATH_PYTHON and the rest of the python autotools bits allow using a
$PYTHON env var to declare a specific python interp to use (arbitrary name
and location), but `python-config` ignores that. Means the -I flags might
not be correct for the python used elsewhere. Should use `${PYTHON}-config`
instead for consistency.
2. python-config is only available as of python2.5, but package claims to
work with python2.4. That suggests using python2.4 won't get the -I flags
for python, which is a build problem.
3. This whole exlpicit hand-coded PYTHON_INCLUDES setting is not needed at
all, since the earlier AM python macros handle it automatically.

Original issue reported on code.google.com by [email protected] on 19 Jun 2009 at 10:10

./configure error, 1.1.7 on Karmic Koala

What steps will reproduce the problem?
1. ./configure in extracted directory

What is the expected output? What do you see instead?
Expected to complete process, instead receive error:
checking for DEPS... configure: error: Package requirements (libxslt
                  gthread-2.0
                  pygtk-2.0) were not met:

No package 'gthread-2.0' found
No package 'pygtk-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DEPS_CFLAGS
and DEPS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

What version of the product are you using? On what operating system?
1.1.7 on Karmic Koala


Original issue reported on code.google.com by [email protected] on 17 Mar 2010 at 7:44

Cannot build pywebkitgtk

When trying to build pywebkitgtk 1.0.2, I get this output:

 gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/python2.6
-I/usr/include/libxml2 -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/webkit-1.0
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12 -march=x86-64
-mtune=generic -O2 -pipe -MT
javascriptcore/webkit_la-javascriptcore_types.lo -MD -MP -MF
javascriptcore/.deps/webkit_la-javascriptcore_types.Tpo -c
javascriptcore/javascriptcore_types.c -o
javascriptcore/webkit_la-javascriptcore_types.o >/dev/null 2>&1
(cd . \
     && /usr/bin/pygobject-codegen-2.0 \
        --register /usr/share/pygtk/2.0/defs/gdk-types.defs \
        --register /usr/share/pygtk/2.0/defs/gtk-types.defs \
        --override webkit.override \
        --prefix pywebkit webkit.defs) 2>&1 >gen-webkit.c | tee webkit.errors \
    && ! grep -q -v "^\*\*\*INFO\*\*\*" webkit.errors \
    && cp gen-webkit.c webkit.c \
    && rm -f gen-webkit.c
/usr/share/pygobject/2.0/codegen/definitions.py:42: DeprecationWarning:
object.__init__() takes no parameters
  str.__init__(self, type_name)
***INFO*** There are no declared global functions.
***INFO*** The coverage of methods is 100.00% (73/73)
***INFO*** There are no declared virtual proxies.
***INFO*** There are no declared virtual accessors.
***INFO*** There are no declared interface proxies.
make[1]: *** [webkit.c] Error 1
make[1]: Leaving directory
`/tmp/yaourt-tmp-andrew/aur-pywebkitgtk/pywebkitgtk/src/pywebkitgtk-1.0.2'
make: *** [all] Error 2


This is on ArchLinux.
python: 2.6
pygtk: 2.13.0
libwebkit: 1.0.1


Original issue reported on code.google.com by [email protected] on 18 Nov 2008 at 12:31

GLib-ERROR **: The thread system is not yet initialized. aborting...

What steps will reproduce the problem?
1. Open the downloaded tarball
2. Run the demo browser
3. see output

What is the expected output? What do you see instead?
I expect a browser, I see an error

What version of the product are you using? On what operating system?
The latest version in the Ubuntu repos

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 27 Nov 2009 at 12:12

  • Merged into: #40

Compiled code is recompiled during 'make install'

pyewbkitgtk-1.1.5 on OS X 10.4, patched per Issue #35 to use the automatic
PYTHON_INCLUDES (same result if I patch the python-config pathname, doesn't
even compile at all otherwise) and Issue #31...

PYTHON=/sw/bin/python2.6 ./configure --prefix=/sw --disable-static
PKG_CONFIG_PATH="/sw/lib/fontconfig2/lib/pkgconfig:$PKG_CONFIG_PATH"
[nothing unusual, all dependencies found]
make
[nothing unusual, all .c->.o are compiled and libtool appears to link the
webkit.so module)
make install DESTDIR=/sw/build.build/root-pywebkitgtk-py26-1.1.5-1
[codegen reruns to generate webkit/gen-webkit.c. Twice. Why at all?]
[webkit.c is compiled and webkit.so is linked; but I already had webkit.so]

So the bug is that gen-webkit.c is regenereated during 'make install', as
if it has a makefile dependency on some part of the install target
location. Given its timestamp is updated, I assume that's what leads to
recompiling/relinking.

Original issue reported on code.google.com by [email protected] on 20 Jun 2009 at 1:03

pygtk-codegen-2.0 is deprecated, use pygobject-codegen-2.0 instead

Running './autogen.sh && make' from svn r76 gives the following output
(full output attached):

note: pygtk-codegen-2.0 is deprecated, use pygobject-codegen-2.0 instead


This causes the build to fail.

I have attached pygobject-codegen.patch that replaces "pygtk-codegen-2.0"
with "pygobject-codegen-2.0".  I have also edited webkit.defs to use "enum"
instead of "define-enum" as in
http://svn.gnome.org/viewvc/pygobject/trunk/codegen/README.defs?view=markup
.  I can build pywebkitgtk successfully after applying this patch.

Distro: Ubuntu Intrepid
pywebkitgtk:  svn HEAD (revision 76)

Original issue reported on code.google.com by [email protected] on 17 Oct 2008 at 9:36

Attachments:

fails to build in mingw32

I want to build pywebkitgtk on windows with mingw32. But it did not work.
It seems that the pywebkitgtk were not prepared for mingw32.

The error messages i met are as follows:
$./configure
.....
checking for python script directory... c:\Python25\Lib\site-packages
checking for python extension module directory... c:\Python25\Lib\site-packages
checking for headers required to compile python extensions... not found
configure: error: could not find Python headers

Original issue reported on code.google.com by [email protected] on 25 Sep 2008 at 9:12

The clean target is not completly working

What steps will reproduce the problem?
1. build pywebkitgtk
2. do a clean

What is the expected output? What do you see instead?
There are some new files that should be cleaned. The list is :
pywebkitgtk-1.0.pc
config.status
config.h
Makefile
stamp-h1
libtool
config.log

What version of the product are you using? On what operating system?
1.0.1 on Ubuntu intrepid

Please provide any additional information below.
Here is a diff of the Makefile.am that should fix that.

Original issue reported on code.google.com by [email protected] on 14 Aug 2008 at 3:04

Attachments:

enums needed for webkit.Download are not wrapped

What steps will reproduce the problem?
webkit.Download.get_status() returns a WebKitDownloadStatus object, however, 
that class is nowhere to be found in pywebkitgtk, so there's nothing to compare 
it with.

Same with the 'error' signal on webkit.Download

What version of the product are you using?
1.1.6-1.1.7
On what operating system?
Same on all OSes


Please provide any additional information below.
I had to use this hack to make use of webkit.Download

webkit.WebKitDownloadStatus = type(webkit.Download().get_status())

webkit.DOWNLOAD_STATUS_ERROR = webkit.WebKitDownloadStatus(-1)
webkit.DOWNLOAD_STATUS_CREATED = webkit.WebKitDownloadStatus(0)
webkit.DOWNLOAD_STATUS_STARTED = webkit.WebKitDownloadStatus(1)
webkit.DOWNLOAD_STATUS_FINISHED  = webkit.WebKitDownloadStatus(3)
webkit.DOWNLOAD_STATUS_CANCELLED  = webkit.WebKitDownloadStatus(2)

Original issue reported on code.google.com by [email protected] on 21 Jul 2010 at 3:39

  • Merged into: #44

Version Number

It would be great if the version of pywebkitgtk could be determined from
within a python program.

Original issue reported on code.google.com by [email protected] on 10 Nov 2009 at 3:17

Error building on OSX

Tried to build pywebkitgtk on OS X Leopard 10.5.7 against webkit-gtk
version 1.1.7 installed via MacPorts.

./configure --prefix=/opt/local
make

Produced this error:

libtool: link: gcc -Wl,-undefined -Wl,dynamic_lookup -o .libs/webkit.so
-bundle  webkit/.libs/webkit_la-webkitmodule.o
javascriptcore/.libs/webkit_la-javascriptcore_types.o
webkit/.libs/webkit_la-webkit.o   -L/opt/local/lib
/opt/local/lib/libxslt.dylib /opt/local/lib/libwebkit-1.0.dylib
/opt/local/lib/libgtk-x11-2.0.dylib /opt/local/lib/libsoup-2.4.dylib
/opt/local/lib/libgdk-x11-2.0.dylib /opt/local/lib/libatk-1.0.dylib
/opt/local/lib/libgdk_pixbuf-2.0.dylib
/opt/local/lib/libpangocairo-1.0.dylib /opt/local/lib/libXinerama.dylib
/opt/local/lib/libXi.dylib /opt/local/lib/libXrandr.dylib
/opt/local/lib/libXcursor.dylib /opt/local/lib/libXcomposite.dylib
/opt/local/lib/libXdamage.dylib /opt/local/lib/libpangoft2-1.0.dylib
/opt/local/lib/libXext.dylib /opt/local/lib/libXfixes.dylib
/opt/local/lib/libcairo.dylib /opt/local/lib/libpixman-1.dylib
/opt/local/lib/libpng12.dylib /opt/local/lib/libXrender.dylib
/opt/local/lib/libX11.dylib /opt/local/lib/libXau.dylib
/opt/local/lib/libXdmcp.dylib /opt/local/lib/libpango-1.0.dylib
/opt/local/lib/libfontconfig.dylib /opt/local/lib/libexpat.dylib
/opt/local/lib/libfreetype.dylib /opt/local/lib/libxml2.dylib -lpthread -lz
-lm /opt/local/lib/libgnutls.dylib /opt/local/lib/libgcrypt.dylib
/opt/local/lib/libgpg-error.dylib /opt/local/lib/libgio-2.0.dylib
/opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib
/opt/local/lib/libglib-2.0.dylib /opt/local/lib/libintl.dylib
/opt/local/lib/libiconv.dylib    -framework Carbon
-Wl,-exported_symbols_list,.libs/webkit-symbols.expsym
ld: duplicate symbol __PyGtk_API in webkit/.libs/webkit_la-webkit.o and
webkit/.libs/webkit_la-webkitmodule.o
collect2: ld returned 1 exit status
make[1]: *** [webkit.la] Error 1
make: *** [all] Error 2


Adding this line to webkit.override above the pygtk/pygtk.h include fixed
the problem and allowed the compilation to continue:
#define NO_IMPORT_PYGTK

But running the demo in demos/tabbed_browser.py produces this error:

Traceback (most recent call last):
  File "demos/tabbed_browser.py", line 30, in <module>
    import webkit
ImportError:
dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
/site-packages/gtk-2.0/webkit.so,
2): Symbol not found: __ZN7WebCore15PurgeableBuffer13makePurgeableEb
  Referenced from: /opt/local/lib/libwebkit-1.0.2.dylib
  Expected in: dynamic lookup

Which I traced down to here:

https://bugs.webkit.org/show_bug.cgi?id=23057

Which I managed to fix with their attached patch & recompiling webkit-gtk:

--- WebCore/platform/PurgeableBuffer.h.orig
+++ WebCore/platform/PurgeableBuffer.h
@@ -62,7 +62,7 @@ namespace WebCore {
         mutable State m_state;
     };

-#if !PLATFORM(DARWIN) || defined(BUILDING_ON_TIGER) || PLATFORM(QT)
+#if !PLATFORM(DARWIN) || defined(BUILDING_ON_TIGER) || PLATFORM(QT) ||
PLATFORM(GTK)
     inline PurgeableBuffer* PurgeableBuffer::create(const char*, size_t) {
return 0; }
     inline PurgeableBuffer::~PurgeableBuffer() { }
     inline const char* PurgeableBuffer::data() const { return 0; }


Original issue reported on code.google.com by [email protected] on 9 Jun 2009 at 8:50

Facebook causes segfault

What steps will reproduce the problem?
1. run the attached file
2. click the button
3. log into facebook

once logged in, you will see the following printed to the console, when you
close the window it segfaults

john@nzjrs-laptop:~/Desktop$ python crash.py 
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: NP_Initialize
** Message: NP_Initialize succeeded
crash.py:22: Warning: invalid uninstantiatable type `(null)' in cast to
`GtkWidget'
  gtk.main()
Segmentation fault

What version of the product are you using? On what operating system?
Ubuntu Intrepid, Python 2.5.2, python-webkit 1.0.1, libwebkit 1.0.1, Gtk
2.14.4, PyGtk 2.13



Original issue reported on code.google.com by John.Stowers on 16 Jan 2009 at 12:42

Attachments:

Error while importing webkit


What steps will reproduce the problem?
1. Compile and Install WebkitGtk 1.1.1
2. Compile and Install pywebkitgtk-1.1
3. Fire python and import webkit 

What is the expected output? What do you see instead?
Webkit  should be imported, Instead of that I get 

ImportError: /usr/lib/python2.6/dist-packages/gtk-2.0/webkit.so: undefined
symbol: webkit_web_view_get_encoding

What version of the product are you using? On what operating system?
Ubuntu 9.04 Alpha 6
Python 2.6.1+



Original issue reported on code.google.com by [email protected] on 14 Mar 2009 at 10:41

segfault when calling WebBackForwardList.get_back_list_with_limit()

What steps will reproduce the problem?
1. create a webview
2. get some history in it
3. call get_back_list_with_limit 

What is the expected output?
a list is returned
What do you see instead?
segfault

What version of the product are you using?
1.1.6 - 1.1.7
On what operating system?
Fedora 11-12


Please provide any additional information below.
This also happens with its counterpart, get_forward_list_with_limit()
It happens regardless of the number or type of arguments given to that method.
Also, this never happens on Ubuntu.

I've attached a gdb traceback and a valgrind log.

Original issue reported on code.google.com by [email protected] on 21 Jul 2010 at 3:30

Attachments:

Cannot install pywebkitgtk-1.1.5

What steps will reproduce the problem?
1. Open a terminal
2. Type ./configure


What is the expected output? What do you see instead?
The last thing in the terminal I had is :
"checking for DEPS... configure: error: Package requirements (libxslt,
                  pygtk-2.0) were not met:

No package 'libxslt' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DEPS_CFLAGS
and DEPS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details."

I installed libxslt1.1, but it does not work.


What version of the product are you using? On what operating system?
pywebkitgtk-1.1.5 (Ubuntu 9.04)

Original issue reported on code.google.com by [email protected] on 5 Jul 2009 at 12:08

pkg-config variable 'codegendir' should be taken from pygobject-2.0

The configure script computes a PYGTK_CODEGENDIR variable by reading the 
pkg-config variable 'codegendir' from the pygtk-2.0 project. The functionality 
has been moved to pygobject with a backwards-compatibility variable being kept 
in pygtk-2.0. However, the value of this variable is such that it works only if 
pygobject and pygtk are installed with the same prefix. This may be the case 
most of the time but pywebkitgtk cannot be built if they are installed in 
different places for some reason.

The solution would at least include this patch:

diff -u -d -r pywebkitgtk-1.1.7/configure.ac 
pywebkitgtk-1.1.7-patched/configure.ac
--- pywebkitgtk-1.1.7/configure.ac  2009-10-03 05:35:23.000000000 +0200
+++ pywebkitgtk-1.1.7-patched/configure.ac  2010-07-11 21:39:27.474455577 +0200
@@ -66,7 +66,7 @@

 dnl check for pygtk codegen dir
 AC_MSG_CHECKING(for pygtk codegendir)
-PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0`
+PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygobject-2.0`
 AC_SUBST(PYGTK_CODEGENDIR)
 AC_MSG_RESULT($PYGTK_CODEGENDIR)


Also, renaming the PYGTK_CODEGENDIR variable accordingly might be a good idea.

Original issue reported on code.google.com by [email protected] on 12 Jul 2010 at 3:31

file:/// urls not working

What steps will reproduce the problem?
1. Use the open method or the demo browser to load a local file with a
file:/// url

What is the expected output? What do you see instead?

The expected behavior is for WebKit to load the HTML file. WebKit is not
loading the HTML file.

What version of the product are you using? On what operating system?

This problem occurs when using the latest pywebkitgtk bindings from Git
with the libwebkit-1.0-1-0~svn35067-0ubuntu1~hardyppa1 package from the
Ubuntu WebKit PPA. Earlier builds of WebKit do not exhibit this problem
(rev 34798 from the PPA works just fine)

Original issue reported on code.google.com by [email protected] on 13 Jul 2008 at 11:20

make fails if libxslt-devel isn't installed

What steps will reproduce the problem?
1. Don't install libxslt-devel.
2. Run autogen.sh, notice it doesn't complain.
3. Run make.

What is the expected output? What do you see instead?

I expect to see a successful build.  Instead I see this:

grep: /usr/lib/libxslt.la: No such file or directory
/usr/bin/sed: can't read /usr/lib/libxslt.la: No such file or directory
libtool: link: `/usr/lib/libxslt.la' is not a valid libtool archive
make[1]: *** [webkit.la] Error 1

What version of the product are you using? On what operating system?

r57

Please provide any additional information below.

Installing libxslt-devel fixed it for me.

Original issue reported on code.google.com by [email protected] on 8 Jul 2008 at 1:08

How to add new-window handler?

With Gecko and Python, the gtkmozembed module, it can use a "new-window"
handler:

  The "new-window" signal is emitted any time that a new toplevel window is
requested
  by the document. This will happen in the case of a window.open() in
JavaScript. 
  Responding to this signal allows you to surround a new toplevel window
with your 
  chrome. You should return the newly created GtkMozEmbed object via the
retval. 

The PyQt4.QtWebKit can do something similar that.
How to do in in PyWebKitGtk?

Original issue reported on code.google.com by [email protected] on 15 Sep 2008 at 2:15

example web site which segfaults the pywebkitgtk demo browser

http://partyliveonline.com - use a username of "test" and a password of
"ffffff" or maybe it's "tttttt" please respect the site, it's running LIVE.
i was stunned and amazed to find that webkit is good enough to run a
pyjamas-auto-generated site (try http://lkcl.net) which is a good
indication that the javascript is a long, long way along - congratulations!
the next test i tried - http://partyliveonline.com - segfaulted the demo
_instantly_ just after a login.

Original issue reported on code.google.com by [email protected] on 15 Aug 2008 at 12:19

ImportError: No module named webkit

What steps will reproduce the problem?
1. ./autogen.sh
2. make
3. make install
4. python demos/webrowser.py

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "demos/webbrowser.py", line 26, in <module>
    import webkit
ImportError: No module named webkit

The webrowser doesn't start.

Libraries have been installed in:
   /usr/local/lib/python2.5/site-packages/gtk-2.0

What version of the product are you using? On what operating system?

Webkit from SVN
pywebkitgtk from SVN

Ubuntu 8.04 - Hardy Heron 

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 3 Aug 2008 at 12:15

LDFLAGS not set

When executing ./autogen.sh under gNewSense 2.0 with Python 2.5 installd, I
get this error and I am not able to compile:
 - common_ldflags: variable `PYTHON_LDFLAGS' is used but `PYTHON_LDFLAGS'
is undefined

And, when runing aclocal inside pywebkitgtk's folder, I get this error:
 - aclocal: configure.ac: 42: macro `AM_CHECK_PYTHON_HEADERS' not found in
library

I'm using this guide [1] to compile pywebkitgtk, so I can install gwibber.

[1] https://wiki.ubuntu.com/gwibber

Original issue reported on code.google.com by [email protected] on 8 Aug 2008 at 2:38

API documentation

We need API documentation to make it easier for developers to use the library. 

Probably make it part of the release after next.

Original issue reported on code.google.com by [email protected] on 9 Aug 2008 at 12:43

Add printing support

WebkitGtk 1.1.5 and above has support for printing. The attached file
enables this in the bindings as well (it also does a version requirement
bump to 1.1.5)

Original issue reported on code.google.com by [email protected] on 26 May 2009 at 8:26

Attachments:

Missing gthread-2.0 link at buildtime

Since pywebkitgtk uses the g_thread_init() function to ensure that threads
are properly present, it should link against gthread-2.0, but it doesn't
look like it does right now (it's only inferred out of other libraries if
the --as-needed linker flag is not used).

This results in an undefined symbol at runtime when loading the extension,
for instance:

flame@yamato tree % gwibber 
Traceback (most recent call last):
  File "/usr/bin/gwibber", line 55, in <module>
    from gwibber.client import GwibberClient
  File "/usr/lib64/python2.6/site-packages/gwibber/client.py", line 12, in
<module>
    from . import gwui, config, gintegration, configui, resources
  File "/usr/lib64/python2.6/site-packages/gwibber/gwui.py", line 9, in
<module>
    import webkit, gtk, copy
ImportError: /usr/lib64/python2.6/site-packages/webkit-1.0/webkit.so:
undefined symbol: g_thread_init

The fix is simply to add gthread-2.0 to the list of DEPS in the
PKG_CHECK_MODULES macro call.

Original issue reported on code.google.com by flameeyes on 30 Aug 2009 at 9:58

Should be able to add new URL handlers for WebKit to load


This is something Per Persson brought up in an email. Below is the email he
sent:

--
Hi,

with WebKit and python on Mac OS X, using the PyObjC bindings, I can implement
an URL scheme handler (e.g. myscheme:///foo/bar) by  subclassing
NSURLProtocol, like so:

class MyURLProtocol(NSURLProtocol):
    def canInitWithRequest_(klass, request):
        if request.URL().scheme() == u'myscheme':
            return True
        return False
    def canonicalRequestForRequest_(klass, request):
        return request
    def startLoading(self):
        client = self.client()
        request = self.request()
        data = mydata(request.URL())
        response = NSURLResponse.alloc
().initWithURL_MIMEType_expectedContentLength_textEncodingName_(
                request.URL(),
                u'text/html',
                len(data),
                u'utf-8',
        )
        client.URLProtocol_didLoadData_(self, buffer(data))
        client.URLProtocolDidFinishLoading_(self)
    def stopLoading(self):
        pass
def setup():
    NSURLProtocol.registerClass_(MyURLProtocol)

For a full example, see e.g. http://pyobjc.sourceforge.net/examples/
pyobjc-framework-WebKit/PyDocURLProtocol/index.html

I guess it is possible to do something similar using PyWebKitGtk, but I have a
hard time finding how to go about it.
Any hints or pointers to examples/docs to get me started in the right
direction would be greatly appreciated.

Best regards,
Per

Original issue reported on code.google.com by [email protected] on 22 Jun 2008 at 8:50

WebPolicyDecision Missing

I've tried to build and install pywebkitgtk1.1.3 from source tarball,
against the release tarball of webkitgtk1.1.3. Building was successful and
I'm actually able to use it (tabbed_browser.py works). In my application I
use the "navigation-policy-decision-requested" signal, I can connect it
without any error, and my callback function is getting called normally. The
issue arise when I try to use the WebKitPolicyDecision object, and the
following message is dumped to the console : 

Traceback (most recent call last):
  File "test113.py", line 51, in request_decision_policy_cb
    self.use(policyDecision)
AttributeError: 'myWebView' object has no attribute 'use'

The object (WebKitPolicyDecision) exists and a print gives me this result :

<__main__.WebKitWebPolicyDecision object at 0x88643c4
(WebKitWebPolicyDecision at 0x8937960)>

Strange since the object is not in the webkit module.

After having a look at webkit.c I found that there isn't any generated
methode for the policydecision object in that are defined in webkit-1.1.defs :

Really strange, this is the content of webkit.error
Warning: generating old-style constructor for:webkit_network_request_new
Warning: Constructor for WebKitWebHistoryItem needs to be updated to new API
         See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
Warning: Constructor for WebKitNetworkRequest needs to be updated to new API
         See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
***INFO*** There are no declared global functions.
***INFO*** The coverage of methods is 100.00% (105/105)
***INFO*** There are no declared virtual proxies.
***INFO*** There are no declared virtual accessors.
***INFO*** There are no declared interface proxies.

My operating is fedora core 9. Also during configure process,
pygobject-codegen is not found, and it falls back to pygtk codegen.

Any hint about this ?


Original issue reported on code.google.com by [email protected] on 31 Mar 2009 at 10:33

Segmentation fault on destroy

What steps will reproduce the problem?
1. Start a child GTK dialog with a WebView child from a parent GTK dialog
2. On close of the child GTK dialog, call WebView.destroy()
3. Segmentation Fault

What is the expected output? What do you see instead?
I expect the control to be destroyed. Instead it faults over half of the time.

What version of the product are you using? On what operating system?
1.1.5-1
Ubuntu Jaunty

Please provide any additional information below.

class BrowserDialog(gtk.Dialog):
  def __init__(self, parent):
    gtk.Dialog.__init__(self, parent = parent, title = 'Find install file')
    self._scrolled_window = sw = gtk.ScrolledWindow()
    self.browser = b = webkit.WebView()
    ...
    self.connect('delete_event', self._handle_close)
    ...

  def _handle_close(self, *args):
    ...
    print 'before self.browser.destroy()'
    # segmentation fault here:
    self.browser.destroy()
    print 'before self.destroy()'
    self.destroy()


I am not sure if this is a bug, or if I am simply not using it correctly.
Almost all examples on the web are bad ones for this use case as they are
lazy and call gtk.main_quit() when the browser closes. In my use case I pop
up a browser in a child dialog, so I want to be able to close that dialog
and ensure the memory for the browser is reclaimed.

Original issue reported on code.google.com by [email protected] on 1 Sep 2009 at 3:18

add javascript execution / evaluation capabilities

        about = "<html><body id='body'></body></html>"
        self._browser.load_string(about, "text/html", "iso-8859-15", "about:")

        self.show_all()

    def js_test(self):

        main_frame = self._browser.get_main_frame()
        print dir(main_frame)
        ctx = main_frame.gjs_get_global_context()
        print dir(ctx)
        doc = ctx.get_by_name("document")
        print doc, dir(doc)
        doc.fred = 5
        print doc.fred
        win = doc.get_by_name("window")
        print win, dir(win)
        print doc.get_by_name("fred")
        print doc.get_by_name("joe")
        #doc.eval("para = document.createTextNode('Some content.');")
        ctx.eval("console.error('hello');")

doc.execute("document.getElementById('body').appendChild(document.createTextNode
('Some
content.'));")
        #doc.execute("document.appendChild(document.createTextNode('Some
content.'));")
        #doc.execute("para2 = document.createTextNode('Some content.');")
        #para = doc.get_by_name("para")
        #print "para", para, para.get_string()
        #doc.execute("document.appendChild(para);")

    def _set_title(self, title):
        self.props.title = title

    def _loading_start_cb(self, view, frame):
        main_frame = self._browser.get_main_frame()
        if frame is main_frame:
            self._set_title(_("Loading %s - %s") %
(frame.get_title(),frame.get_uri()))
        self._toolbar.set_loading(True)

    def _loading_stop_cb(self, view, frame):
        # FIXME: another frame may still be loading?
        self._toolbar.set_loading(False)
        self.js_test()

Original issue reported on code.google.com by [email protected] on 20 Aug 2008 at 2:28

Attachments:

I make wrapper using Cython for JSContextRef that way u can call JS functions etc

Wrapper so you can call JS functions from pygtkweb
Still incomplete, I will probably make it so you can call python functions
from the JS  etc.

But you can do stuff like

ctx = jswebkit.JSContext(self.get_main_frame().get_global_context())
        print ctx.EvaluateScript("document.title")
        #e = ctx.EvaluateScript("document.body.getElementsByTagName('a')")
        d = ctx.EvaluateScript("document.body")
        e = d.hasAttribute("a")
        print e
        print e.getPropertyNames()
        #w.alert("a","z")
        #print d.title

Original issue reported on code.google.com by [email protected] on 18 Apr 2009 at 12:13

import webkit failed

What steps will reproduce the problem?
1. ./configure --prefix=/usr && make && make install
2. import webkit fails with:
ImportError: No module named webkit

What is the expected output? What do you see instead?
that there is no output and that webkit module is imported

What version of the product are you using? On what operating system?
1.1.6 on linux with python 2.6.2

Please provide any additional information below.

why webkit.so is installed by default in 
/usr/lib/python2.6/sites_packages/webkit-1.0 ??? i think that's why it's 
not working...

why do not use ./setup.py and the tools from python to create the package ?
?

Original issue reported on code.google.com by [email protected] on 28 Aug 2009 at 11:10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.