+ //If it is requsting the page itself then return as we have already
+ //loaded it from the archive
+ if(webKitCtrl->m_vfsurl == uri)
+ return;
+
+ wxFSFile* file = handler->GetFile(uri);
+ if(file)
+ {
+ //We load the data into a data url to save it being written out again
+ size_t size = file->GetStream()->GetLength();
+ char *buffer = new char[size];
+ file->GetStream()->Read(buffer, size);
+ wxString data = wxBase64Encode(buffer, size);
+ delete[] buffer;
+ wxString mime = file->GetMimeType();
+ wxString path = "data:" + mime + ";base64," + data;
+ //Then we can redirect the call
+ webkit_network_request_set_uri(request, path);
+ }
+