如何在pywebkit中启用xmlhttprequest for file://协议?
就像chrome一样
http://www.google.com/support/forum/p/Chrome/thread?tid=171316324d16747b&hl=en
发布于 2011-05-20 05:56:32
在WebView上设置enable-file-access-from-file-uris属性
view = webkit.WebView()
settings = view.get_settings()
settings.set_property('enable-file-access-from-file-uris', 1)
view.open('file://./foo.html')将file://./bar.html的内容写入正文的示例文件foo.html:
<html>
<head><script type="text/javascript" src="jquery-1.4.4.js"></script></head>
<body><script>
$.ajax({url: 'file://./bar.html', success: function(data) {
document.write(data);
}
});
</script></body></html>https://stackoverflow.com/questions/6056357
复制相似问题