diff --git a/www/checkup/dependency-warning.js b/www/checkup/dependency-warning.js new file mode 100644 index 000000000..0b11fcf1e --- /dev/null +++ b/www/checkup/dependency-warning.js @@ -0,0 +1,17 @@ +(function () { + var first = true; + window.addEventListener('error', function (ev) { + if (!ev) { return; } + var srcElement = ev.srcElement; + if (!srcElement) { return; } + var nodeName = srcElement.nodeName; + if (nodeName !== 'SCRIPT') { return; } + var src = srcElement.src; + if (!/\/bower_components\/.*/.test(src)) { return; } + if (first) { + document.write(`
It's possible that this server's administrators forgot to install its client-side dependencies with 'bower update'.
`); + first = false; + } + document.write(`Failed to load ${src}
.