J-Lyric.net歌詞コピーページ
{
"name": "J-Lyric.net歌詞コピー",
"version": "1.0.0",
"manifest_version": 3,
"description": "J-Lyric.net歌詞コピー",
"content_scripts": [
{
"matches": ["https://j-lyric.net/artist/*"],
"js": ["./app.js"]
}
]
}
const main = () => {
const div = document.createElement('div');
const button = document.createElement('button');
div.appendChild(button);
document.getElementById('ttb').after(div);
div.style.textAlign = 'center';
button.textContent = '歌詞をコピーする';
button.style.width = '150px';
button.style.height = '50px';
button.onclick = () => {
if (navigator.clipboard) {
navigator.clipboard.writeText(
document.querySelector('#Lyric').innerText.replace(/<br>/g, '\n')
);
}
alert('歌詞をコピーしました');
};
};
main();