-
[chrome extension] How to make image button on content scriptFrontend/chrome extension 2020. 3. 23. 15:03
chrome extension
create button script
const iconBtn = document.createElement('button'); const iconBtnUrl = URL; iconBtn.setAttribute('id', 'iconbtn'); iconBtn.style.backgroundColor = 'transparent !important;'; iconBtn.style.padding = '0px'; iconBtn.style.borderWidth = '0px'; iconBtn.style.border = 'none'; iconBtn.style.position = 'absolute'; iconBtn.style.color = '#FFFFFF'; iconBtn.addEventListener('click', (e) => { // TODO }, false); iconBtn.innerHTML = '<img class="btn-img" src="'+ iconBtnUrl +'">'; document.body.appendChild(iconBtn);
'Frontend > chrome extension' 카테고리의 다른 글