Created
February 12, 2020 08:20
-
-
Save unarist/c6fb8145cc03506ba7d269e875c4ca71 to your computer and use it in GitHub Desktop.
bookmarklet template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script> | |
const x = | |
function() { | |
// bookmarklet body | |
}; | |
document.body.innerHTML = ''; | |
document.body.appendChild(document.createTextNode('右のリンクをブックマークバーにドラッグして登録: ')); | |
document.body.appendChild(Object.assign(document.createElement('a'), {href: `javascript:(${encodeURIComponent(x.toString())})()`, textContent: 'example'})); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment