fix css not being loaded
This commit is contained in:
parent
ac4e05e9f2
commit
f7b95b0ba2
4 changed files with 17 additions and 7 deletions
5
app/src/main/java/dev/vendicated/vencord/Constants.java
Normal file
5
app/src/main/java/dev/vendicated/vencord/Constants.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package dev.vendicated.vencord;
|
||||
|
||||
public class Constants {
|
||||
public static final String JS_BUNDLE_URL = "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.js";
|
||||
}
|
|
@ -11,8 +11,6 @@ import java.net.URL;
|
|||
import java.util.Locale;
|
||||
|
||||
public class HttpClient {
|
||||
public static final String VENCORD_BUNDLE_URL = "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.js";
|
||||
|
||||
public static final class HttpException extends IOException {
|
||||
private final HttpURLConnection conn;
|
||||
private String message;
|
||||
|
@ -53,7 +51,7 @@ public class HttpClient {
|
|||
VencordMobileRuntime = readAsText(is);
|
||||
}
|
||||
|
||||
var conn = fetch(VENCORD_BUNDLE_URL);
|
||||
var conn = fetch(Constants.JS_BUNDLE_URL);
|
||||
try (var is = conn.getInputStream()) {
|
||||
VencordRuntime = readAsText(is);
|
||||
}
|
||||
|
|
|
@ -114,12 +114,11 @@ public class MainActivity extends Activity {
|
|||
|
||||
public void handleUrl(Uri url) {
|
||||
if (url != null) {
|
||||
if (!url.getAuthority().contains("discord")) return;
|
||||
if (!url.getAuthority().equals("discord.com")) return;
|
||||
if (!wvInitialized) {
|
||||
wv.loadUrl(url.toString());
|
||||
} else {
|
||||
wv.evaluateJavascript("Vencord.Webpack.Common.NavigationRouter.transitionTo(\"" + url.getPath() + "\")", (result) -> {
|
||||
});
|
||||
wv.evaluateJavascript("Vencord.Webpack.Common.NavigationRouter.transitionTo(\"" + url.getPath() + "\")", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,5 +129,4 @@ public class MainActivity extends Activity {
|
|||
Uri data = intent.getData();
|
||||
if (data != null) handleUrl(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,13 @@
|
|||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => document.documentElement.appendChild(
|
||||
Object.assign(document.createElement("link"), {
|
||||
rel: "stylesheet",
|
||||
type: "text/css",
|
||||
href: "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.css"
|
||||
}),
|
||||
{ once: true }
|
||||
));
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue