Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse HTML to XML #1211

Merged
merged 2 commits into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Gluon
* Copyright (c) 2020, 2023, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -81,7 +81,8 @@ public void onPageStarted(WebView view, String url, Bitmap favicon) {
@Override
public void onPageFinished(WebView view, final String url) {
Log.v(TAG, "Page finished: " + url);
NativeWebView.this.webView.evaluateJavascript("document.documentElement.innerHTML", new ValueCallback<String>() {
// convert HTML into XML before it can be parsed into DOM
NativeWebView.this.webView.evaluateJavascript("new XMLSerializer().serializeToString(document)", new ValueCallback<String>() {
@Override
public void onReceiveValue(String s) {
Properties p = new Properties();
Expand Down