sam*_*ias 5

设置enable-file-access-from-file-uris属性WebView:

view = webkit.WebView()
settings = view.get_settings()
settings.set_property('enable-file-access-from-file-uris', 1)
view.open('file://./foo.html')
Run Code Online (Sandbox Code Playgroud)

foo.html将内容写入file://./bar.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>
Run Code Online (Sandbox Code Playgroud)