-
-
- Enables Chromecast support for casting web apps (like Netflix or BBC iPlayer), HTML5 video and screen/tab sharing.
-
-
- Requires a native bridge app to connect with receiver devices. Currently supported on Windows, macOS and Linux.
-
-
- No full public release yet! Pre-release beta version is incomplete and likely buggy.
-
-
-
-
-
- Firefox Extension
-
-
-
-
Bridge:
-
- Windows
-
-
- macOS
-
+
+
+
+
+ Enables Chromecast support for casting web apps (like Netflix or BBC iPlayer), HTML5 video and screen/tab sharing.
+
+
+ Requires a native bridge app to connect with receiver devices. Currently supported on Windows, macOS and Linux.
+
+
+ No full public release yet! Pre-release beta version is incomplete and likely buggy.
+
+
+
-
-
+
+
+
![Screenshot preview, background]()
summary");
+
+// Ext download button
+const downloadExtBtn = document.querySelector(".download__ext");
+
+// App download buttons
+const appListWinBtn = document.querySelector(".app-list__win");
+const appListMacBtn = document.querySelector(".app-list__mac");
+const appListDebBtn = document.querySelector(".app-list__deb");
+const appListRpmBtn = document.querySelector(".app-list__rpm");
+
+
+let platform;
+
+switch (navigator.platform) {
+ case "Win32":
+ case "Win64":
+ platform = "win";
+ downloadAppBtn.textContent = "Windows Bridge";
+ appListWinBtn.hidden = true;
+ break;
+
+ case "MacIntel":
+ platform = "mac";
+ downloadAppBtn.textContent = "macOS Bridge";
+ appListMacBtn.hidden = true;
+ break;
+
+ default:
+ /**
+ * Hide default download button and display other downloads
+ * without details summary.
+ */
+ downloadAppBtn.remove();
+ downloadAppOther.open = true;
+ downloadAppOtherSummary.hidden = true;
+}
+
+
+
const ENDPOINT_URL = "https://api.github.com/repos/hensm/fx_cast/releases/latest";
fetch(ENDPOINT_URL)
@@ -11,16 +53,6 @@ function onResponse (res) {
for (const asset of res.assets) {
const { browser_download_url } = asset;
- // Ext download button
- const downloadExtBtn = document.querySelector(".download__ext");
-
- // App download buttons
- const appListWinBtn = document.querySelector(".app-list__win");
- const appListMacBtn = document.querySelector(".app-list__mac");
- const appListDebBtn = document.querySelector(".app-list__deb");
- const appListRpmBtn = document.querySelector(".app-list__rpm");
-
-
switch (asset.name.match(/.*\.(.*)$/).pop()) {
case "xpi":
downloadExtBtn.href = browser_download_url;
@@ -50,6 +82,24 @@ function onResponse (res) {
break;
}
}
+
+ if (platform) {
+ switch (platform) {
+ case "win":
+ downloadAppBtn.href = appListWinBtn.href;
+ break;
+ case "mac":
+ downloadAppBtn.href = appListMacBtn.href;
+ break;
+
+ default: {
+ return;
+ }
+ }
+
+ downloadAppBtn.removeAttribute("disabled");
+ downloadAppBtn.removeAttribute("title");
+ }
}
function onError (err) {
diff --git a/docs/photon.css b/docs/photon.css
index 8dd45cb..42e5b77 100755
--- a/docs/photon.css
+++ b/docs/photon.css
@@ -44,7 +44,6 @@ select.btn:-moz-focusring {
background-color: var(--btn-bg);
border-radius: 2px;
color: var(--btn-color);
- display: inline-flex;
font-size: 13px;
font-weight: 400;
height: var(--btn-height);
@@ -52,6 +51,10 @@ select.btn:-moz-focusring {
padding: 0 var(--btn-padding);
}
+.btn:not([hidden]) {
+ display: inline-flex;
+}
+
.btn--primary {
--btn-bg: var(--blue-60);
--btn-bg-hover: var(--blue-70);