Skip to content

Commit f7b95b0

Browse files
committed
fix css not being loaded
1 parent ac4e05e commit f7b95b0

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package dev.vendicated.vencord;
2+
3+
public class Constants {
4+
public static final String JS_BUNDLE_URL = "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.js";
5+
}

app/src/main/java/dev/vendicated/vencord/HttpClient.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import java.util.Locale;
1212

1313
public class HttpClient {
14-
public static final String VENCORD_BUNDLE_URL = "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.js";
15-
1614
public static final class HttpException extends IOException {
1715
private final HttpURLConnection conn;
1816
private String message;
@@ -53,7 +51,7 @@ public static void fetchVencord(Activity activity) throws IOException {
5351
VencordMobileRuntime = readAsText(is);
5452
}
5553

56-
var conn = fetch(VENCORD_BUNDLE_URL);
54+
var conn = fetch(Constants.JS_BUNDLE_URL);
5755
try (var is = conn.getInputStream()) {
5856
VencordRuntime = readAsText(is);
5957
}

app/src/main/java/dev/vendicated/vencord/MainActivity.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,11 @@ private void explodeAndroid() {
114114

115115
public void handleUrl(Uri url) {
116116
if (url != null) {
117-
if (!url.getAuthority().contains("discord")) return;
117+
if (!url.getAuthority().equals("discord.com")) return;
118118
if (!wvInitialized) {
119119
wv.loadUrl(url.toString());
120120
} else {
121-
wv.evaluateJavascript("Vencord.Webpack.Common.NavigationRouter.transitionTo(\"" + url.getPath() + "\")", (result) -> {
122-
});
121+
wv.evaluateJavascript("Vencord.Webpack.Common.NavigationRouter.transitionTo(\"" + url.getPath() + "\")", null);
123122
}
124123
}
125124
}
@@ -130,5 +129,4 @@ protected void onNewIntent(Intent intent) {
130129
Uri data = intent.getData();
131130
if (data != null) handleUrl(data);
132131
}
133-
134132
}

app/src/main/res/raw/vencord_mobile.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,13 @@
3434
return false;
3535
}
3636
};
37+
38+
document.addEventListener("DOMContentLoaded", () => document.documentElement.appendChild(
39+
Object.assign(document.createElement("link"), {
40+
rel: "stylesheet",
41+
type: "text/css",
42+
href: "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.css"
43+
}),
44+
{ once: true }
45+
));
3746
})();

0 commit comments

Comments
 (0)