Last active
June 7, 2019 01:59
-
-
Save kamiazya/45c529ba14cb88ff53c37b2ad7d912b8 to your computer and use it in GitHub Desktop.
aタグのタイトルとURLをCSVで書き出すブックマークレット
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
| javascript:(function () { | |
| const list = []; | |
| for (let e of document.getElementsByTagName('a')) { | |
| list.push(e.textContent.trim() + ',' + e.getAttribute('href').trim()); | |
| } | |
| const bom = new Uint8Array([0xEF, 0xBB, 0xBF]); | |
| const content = list.join('\n'); | |
| const blob = new Blob([bom, content], { type: 'text/csv' }); | |
| const aTag = document.createElement('a'); | |
| aTag.href = window.URL.createObjectURL(blob); | |
| aTag.click(); | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment