Fix inline install with multiple links.
This commit is contained in:
parent
7f7ae9917e
commit
0deeb405b5
16
template.jst
16
template.jst
@ -16,13 +16,15 @@ h1 {
|
|||||||
</head><body>
|
</head><body>
|
||||||
<%= content %>
|
<%= content %>
|
||||||
<script>
|
<script>
|
||||||
var link = document.querySelector('a[href="https://chrome.google.com/webstore/detail/4chan-x/ohnjgmpcibpbafdlkimncjhflgedgpam"]');
|
var links = document.querySelectorAll('a[href="https://chrome.google.com/webstore/detail/4chan-x/ohnjgmpcibpbafdlkimncjhflgedgpam"]');
|
||||||
link.addEventListener('click', function(e) {
|
for (var i = 0; i < links.length; i++) {
|
||||||
if (window.chrome && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey && e.button === 0) {
|
links[i].addEventListener('click', function(e) {
|
||||||
chrome.webstore.install();
|
if (window.chrome && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey && e.button === 0) {
|
||||||
e.preventDefault();
|
chrome.webstore.install();
|
||||||
}
|
e.preventDefault();
|
||||||
}, false);
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body></html>
|
</body></html>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user