Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 1d5d616

Browse files
committed
Update demo server to redirect to Firefox extension in Firefox
1 parent 3086f57 commit 1d5d616

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

netcode.io.demoserver/basic.htm

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
window.netcode.isNativeHelperInstalled(function(err, isInstalled) {
5757
if (!isInstalled) {
58-
$("#netcode_presence").html("<b>Missing Helper</b> (<a href=\"https://github.com/RedpointGames/netcode.io-browser/releases/tag/latest\" target=\"_blank\">install the native helper</a>, reload page after install)");
58+
$("#netcode_presence").html("<b>Missing Helper</b> (fix it by going to the <a href=\"/\">home page</a>)");
5959
return;
6060
}
6161

@@ -100,30 +100,7 @@
100100
});
101101
});
102102
} else {
103-
$("#netcode_presence").html("<b>Not Installed</b> (");
104-
105-
if (chrome && chrome.webstore && chrome.webstore.install && chrome.app) {
106-
if (!chrome.app.isInstalled) {
107-
var presence = $("#netcode_presence");
108-
presence.append(
109-
$("<a></a>")
110-
.attr("href", "https://chrome.google.com/webstore/detail/hpecmifakhimhidjpcpjmihpacijicbd")
111-
.attr("target", "_blank")
112-
.click(function(e) {
113-
chrome.webstore.install(
114-
"https://chrome.google.com/webstore/detail/hpecmifakhimhidjpcpjmihpacijicbd",
115-
function() {
116-
// Reload after install.
117-
location.reload();
118-
},
119-
function() {
120-
e.preventDefault();
121-
});
122-
})
123-
.text("install the extension for your browser"));
124-
presence.append(", reload page after install)");
125-
}
126-
}
103+
$("#netcode_presence").html("<b>Not Installed</b> (fix it by going to the <a href=\"/\">home page</a>)");
127104
}
128105
}, 500);
129106
});

netcode.io.demoserver/index.htm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,19 @@
7474
"href=\"/basic\" role=\"button\">Try demo &raquo;</a>");
7575
});
7676
} else {
77+
var target = "https://chrome.google.com/webstore/detail/hpecmifakhimhidjpcpjmihpacijicbd";
78+
if (navigator.userAgent.indexOf("Firefox") > -1) {
79+
target = "https://addons.mozilla.org/en-US/firefox/addon/netcode-io/";
80+
}
81+
7782
$("#info").html(
7883
"<h1>Missing extension</h1>" +
7984
"<p>To add support for netcode.io in your browser, you first need " +
8085
"to install the netcode.io extension.</p>" +
8186
"<p><a id=\"ext_install\" class=\"btn btn-lg btn-primary\" " +
82-
"href=\"https://chrome.google.com/webstore/detail/hpecmifakhimhidjpcpjmihpacijicbd\" " +
87+
"href=\"" + target + "\" " +
8388
"target=\"_blank\" role=\"button\">Install extension &raquo;</a>");
84-
89+
8590
if (chrome && chrome.webstore && chrome.webstore.install && chrome.app) {
8691
if (!chrome.app.isInstalled) {
8792
var ext_install = $("#ext_install");

0 commit comments

Comments
 (0)