Browse Source

use decode uri

master
Daniel 9 months ago
parent
commit
87b2385f84
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      bookmarklet.html

+ 2
- 2
bookmarklet.html View File

@@ -82,8 +82,8 @@ data:text/html,
}

function exportCode() {
var encoded = "`" + document.getElementById("code").value.replace(/`/gm, "\\`") + "`";
prompt('Copy this as a bookmarklet', "javascript:setText(" + encoded + ")");
var encoded = "`" + encodeURI(document.getElementById("code").value) + "`";
prompt('Copy this as a bookmarklet', "javascript:setText(decodeURI(" + encoded + "))");
}
window.onbeforeunload = function() {
return "If you leave this page, you will lose any unsaved changes.";


Loading…
Cancel
Save