Fix inline install with multiple links.

This commit is contained in:
ccd0 2014-12-15 21:11:49 -08:00
parent 7f7ae9917e
commit 0deeb405b5

View File

@ -16,13 +16,15 @@ h1 {
</head><body>
<%= content %>
<script>
var link = document.querySelector('a[href="https://chrome.google.com/webstore/detail/4chan-x/ohnjgmpcibpbafdlkimncjhflgedgpam"]');
link.addEventListener('click', function(e) {
if (window.chrome && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey && e.button === 0) {
chrome.webstore.install();
e.preventDefault();
}
}, false);
var links = document.querySelectorAll('a[href="https://chrome.google.com/webstore/detail/4chan-x/ohnjgmpcibpbafdlkimncjhflgedgpam"]');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('click', function(e) {
if (window.chrome && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey && e.button === 0) {
chrome.webstore.install();
e.preventDefault();
}
}, false);
}
</script>
</body></html>