webkit_web_view_load_string() を呼び出して html コンテンツを webkitview にロードすると、webkit は常に、html コンテンツで参照されているローカル ファイルまたはリソース (css、javascript、画像) のロードを拒否します。
注:リソースをバイナリにロードするためにGResourceを使用していますか?これは例です:
GBytes *data;
GResource *resource;
GByteArray* gbarray; resource = one_file_get_resource();
.
. . .
g_resources_register (resource);
data = g_resource_lookup_data (resource,"/com/test/resources/index.html", G_RESOURCE_LOOKUP_FLAGS_NONE,NULL);
gbarray = g_bytes_unref_to_array(data);
const gchar* data_char = gbarray->data;
. . .
webkit_web_view_load_string(webView, data_char, NULL, NULL,"");
これは GResources の私のxmlファイルです:
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/test">
<file>resources/index.html</file>
<file>resources/style.css</file>
</gresource>
</gresources>
今私の問題は、index.html が読み込まれているが、css ファイルがないことです。スタイリングなしでhtmlファイルを取得しました!! どうすればこれを解決できますか?