Skip to content

Commit 2c13f09

Browse files
committed
Add download attribute to solution link
To avoid Chrome ignoring clicks on it
1 parent a5d5b66 commit 2c13f09

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

html/js/code.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ addEventListener("load", () => {
127127
setEditorCode(exercise.code, exercise.type)
128128
visible = "exercise"
129129
let link = document.querySelector("#download")
130+
link.setAttribute("download", "solution" + value + ".js")
130131
if (/\.zip$/.test(exercise.file))
131132
link.href = exercise.file
132133
else

0 commit comments

Comments
 (0)