Avoid chunked content encoding. Some WebViewClient debugging. Doesn't go to a blank screen on android so much.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4314 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
b4629acc48
commit
da50792500
4
Makefile
4
Makefile
@ -499,6 +499,10 @@ apkgo: out/TildeFriends-debug.apk
|
|||||||
@adb shell am start com.unprompted.tildefriends/.MainActivity
|
@adb shell am start com.unprompted.tildefriends/.MainActivity
|
||||||
.PHONY: apkgo
|
.PHONY: apkgo
|
||||||
|
|
||||||
|
apklog:
|
||||||
|
@adb logcat *:S tildefriends
|
||||||
|
.PHONY: apklog
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(BUILD_DIR)
|
rm -rf $(BUILD_DIR)
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
10
core/core.js
10
core/core.js
@ -504,7 +504,7 @@ async function staticFileHandler(request, response, blobId, uri) {
|
|||||||
let id = `${stat.mtime}_${stat.size}`;
|
let id = `${stat.mtime}_${stat.size}`;
|
||||||
|
|
||||||
if (request.headers['if-none-match'] === '"' + id + '"') {
|
if (request.headers['if-none-match'] === '"' + id + '"') {
|
||||||
response.writeHead(304, {});
|
response.writeHead(304, {'Content-Length': '0'});
|
||||||
response.end();
|
response.end();
|
||||||
} else {
|
} else {
|
||||||
let data = await File.readFile('core/' + path);
|
let data = await File.readFile('core/' + path);
|
||||||
@ -538,7 +538,7 @@ async function staticDirectoryHandler(request, response, directory, uri) {
|
|||||||
let id = `${stat.mtime}_${stat.size}`;
|
let id = `${stat.mtime}_${stat.size}`;
|
||||||
|
|
||||||
if (request.headers['if-none-match'] === '"' + id + '"') {
|
if (request.headers['if-none-match'] === '"' + id + '"') {
|
||||||
response.writeHead(304, {});
|
response.writeHead(304, {'Content-Length': '0'});
|
||||||
response.end();
|
response.end();
|
||||||
} else {
|
} else {
|
||||||
let data = await File.readFile(directory + filename);
|
let data = await File.readFile(directory + filename);
|
||||||
@ -626,7 +626,7 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
let id = `${stat.mtime}_${stat.size}`;
|
let id = `${stat.mtime}_${stat.size}`;
|
||||||
|
|
||||||
if (request.headers['if-none-match'] === '"' + id + '"') {
|
if (request.headers['if-none-match'] === '"' + id + '"') {
|
||||||
response.writeHead(304, {});
|
response.writeHead(304, {'Content-Length': '0'});
|
||||||
response.end();
|
response.end();
|
||||||
} else {
|
} else {
|
||||||
let data = await File.readFile('core/' + k_static_files[i].path);
|
let data = await File.readFile('core/' + k_static_files[i].path);
|
||||||
@ -664,6 +664,7 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
let id = await new Database(match[1]).get('path:' + match[2]);
|
let id = await new Database(match[1]).get('path:' + match[2]);
|
||||||
if (id) {
|
if (id) {
|
||||||
if (request.headers['if-none-match'] === '"' + id + '"') {
|
if (request.headers['if-none-match'] === '"' + id + '"') {
|
||||||
|
headers['Content-Length'] = '0';
|
||||||
response.writeHead(304, headers);
|
response.writeHead(304, headers);
|
||||||
response.end();
|
response.end();
|
||||||
} else {
|
} else {
|
||||||
@ -676,6 +677,7 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (request.headers['if-none-match'] === '"' + blobId + '"') {
|
if (request.headers['if-none-match'] === '"' + blobId + '"') {
|
||||||
|
headers['Content-Length'] = '0';
|
||||||
response.writeHead(304, headers);
|
response.writeHead(304, headers);
|
||||||
response.end();
|
response.end();
|
||||||
} else {
|
} else {
|
||||||
@ -684,6 +686,7 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (request.headers['if-none-match'] === '"' + blobId + '"') {
|
if (request.headers['if-none-match'] === '"' + blobId + '"') {
|
||||||
|
headers['Content-Length'] = '0';
|
||||||
response.writeHead(304, headers);
|
response.writeHead(304, headers);
|
||||||
response.end();
|
response.end();
|
||||||
} else {
|
} else {
|
||||||
@ -787,6 +790,7 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
let headers = {
|
let headers = {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Content-Security-Policy': 'sandbox',
|
'Content-Security-Policy': 'sandbox',
|
||||||
|
'Content-Length': '0',
|
||||||
};
|
};
|
||||||
response.writeHead(304, headers);
|
response.writeHead(304, headers);
|
||||||
response.end();
|
response.end();
|
||||||
|
@ -159,6 +159,12 @@ public class MainActivity extends Activity {
|
|||||||
.show();
|
.show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onConsoleMessage(android.webkit.ConsoleMessage consoleMessage) {
|
||||||
|
Log.d("tildefriends", consoleMessage.message() + " -- From line " + consoleMessage.lineNumber() + " of " + consoleMessage.sourceId());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
web_view.setWebViewClient(new WebViewClient() {
|
web_view.setWebViewClient(new WebViewClient() {
|
||||||
|
Loading…
Reference in New Issue
Block a user