Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit 7cb35f1

Browse files
authored
Disable stable download on firefox (#960)
1 parent 9681619 commit 7cb35f1

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

src/composables/useDownloadLink.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { toRef } from "vue";
22

33
const data = {
44
chromium: "https://chrome.google.com/webstore/detail/7tv/ammjkodgmmoknidbanneddgankgfejfh",
5-
firefox: "https://addons.mozilla.org/en-US/firefox/addon/7tv",
5+
firefox: "", // gone for now because mozilla is stupid
66
chromium_beta: "https://chrome.google.com/webstore/detail/7tv-nightly/fphegifdehlodcepfkgofelcenelpedj",
77
firefox_beta: "https://addons.mozilla.org/en-US/firefox/addon/7tv-nightly/",
88

src/views/home/HomeDownloads.vue

+42-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@
44
<div class="download-section" name="browsers">
55
<h3>{{ t("home.download_browser") }}</h3>
66

7-
<button v-wave class="browser-download" @click="onBrowserDownload()">
7+
<button
8+
v-wave
9+
v-tooltip="
10+
isMoz
11+
? 'Currently disabled due to gross mishandling by Mozilla. Please use the Nightly version!'
12+
: ''
13+
"
14+
class="browser-download"
15+
:class="{ 'is-moz': isMoz }"
16+
@click="onBrowserDownload()"
17+
>
818
<Logo color="#29b6f6" />
919
<p>
1020
<span>Stable Release</span>
11-
<sub :style="{ color: 'lightgreen' }">Version 3.0.1</sub>
21+
<sub :style="{ color: 'lightgreen', opacity: versions.extension && 1 }">
22+
Version {{ versions.extension }}
23+
</sub>
1224
</p>
1325
</button>
1426

@@ -24,7 +36,9 @@
2436
<Logo color="#cc41f2" />
2537
<p>
2638
<span>Nightly Release</span>
27-
<sub :style="{ color: '#cc41f2' }">Version 3.0.1</sub>
39+
<sub :style="{ color: '#cc41f2', opacity: versions['extension-nightly'] && 1 }"
40+
>Version {{ versions["extension-nightly"] }}</sub
41+
>
2842
</p>
2943
</button>
3044
</div>
@@ -67,6 +81,7 @@
6781
</template>
6882

6983
<script setup lang="ts">
84+
import { reactive } from "vue";
7085
import { useI18n } from "vue-i18n";
7186
import { useActor } from "@/store/actor";
7287
import { useDownloadLink } from "@/composables/useDownloadLink";
@@ -92,6 +107,20 @@ const mobile_dankchat = useDownloadLink("mobile_dankchat");
92107
93108
const desktop_chatterino = useDownloadLink("desktop_chatterino");
94109
110+
const isMoz = browser.name === "Firefox";
111+
const versions = reactive({
112+
extension: "",
113+
"extension-nightly": "",
114+
});
115+
116+
const configs = ["extension", "extension-nightly"];
117+
for (const s of configs) {
118+
const res = fetch(`${import.meta.env.VITE_APP_API_REST}/config/${s}`);
119+
res.then((r) => r.json()).then((r) => {
120+
versions[s as keyof typeof versions] = r.version;
121+
});
122+
}
123+
95124
const onBrowserDownload = (beta?: boolean) => {
96125
if (browser.name === "Firefox") {
97126
openLink(beta ? firefox_beta.value : firefox.value);
@@ -101,6 +130,7 @@ const onBrowserDownload = (beta?: boolean) => {
101130
};
102131
103132
const openLink = (url: string): void => {
133+
if (!url) return;
104134
window.open(`${url}?referrer=${document.location.host}`, "_blank");
105135
};
106136
</script>
@@ -179,6 +209,10 @@ main.home-downloads {
179209
display: grid;
180210
}
181211
212+
sub {
213+
opacity: 0;
214+
}
215+
182216
&.is-nightly-button {
183217
// make a gradient with construction stripes
184218
$color1: rgba(102, 56, 229, 25%);
@@ -194,6 +228,11 @@ main.home-downloads {
194228
$color2 75%
195229
);
196230
}
231+
232+
&:not(.is-nightly-button).is-moz {
233+
opacity: 0.5;
234+
background-image: black;
235+
}
197236
}
198237
}
199238

0 commit comments

Comments
 (0)