Issue 61 in pywebkitgtk: no xmlhttprequest for file:// protocol?

16 views
Skip to first unread message

pyweb...@googlecode.com

unread,
May 19, 2011, 2:15:06 AM5/19/11
to pyweb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 61 by zne...@gmail.com: no xmlhttprequest for file:// protocol?
http://code.google.com/p/pywebkitgtk/issues/detail?id=61

I use some ajax like

xmlhttp.open("GET","test1.txt",false);

find some question on chrome
http://www.google.com/support/forum/p/Chrome/thread?tid=171316324d16747b&hl=en

how to open --allow-file-access-from-files in pywebkit?

thx~

pyweb...@googlecode.com

unread,
Feb 3, 2012, 5:02:18 PM2/3/12
to pyweb...@googlegroups.com

Comment #1 on issue 61 by zmedico: no xmlhttprequest for file:// protocol?
http://code.google.com/p/pywebkitgtk/issues/detail?id=61

As a workaround for this, I override window.XMLHttpRequest with my own
class that uses document.title to send commands to a notify::title signal
callback on the python side. Then the python side uses a
WebKit.execute_script() call reply to the request. For example code, see my
commit here:

http://code.google.com/p/electroshocktherapy/source/detail?r=438ae49894167b9f79c360dc002d6820d957e39b

This allows me use file:/// URIs entirely (removing an http server from my
app), which greatly reduces page loading overhead. It a little bit ugly,
but it works very well.

Reply all
Reply to author
Forward
0 new messages