Estaba escribiendo una extensión de Google Chrome para insertar una imagen en el cuerpo de un sitio web. Actualmente lo hace, pero la imagen se centra completamente en la parte inferior, después del texto del sitio web. Me preguntaba cómo ponerlo en la parte superior izquierda o usar coordenadas para la ubicación. Este es mi código actualmente en JavaScript, ya que no puedo usar CSS para ello.
function imageappend() { const img = document.createElement("img"); img.src = chrome.runtime.getURL("imageedit_1_3932659157.png"); img.style.top = "0"; img.style.left = "0"; img.style.padding = "0"; img.style.margin = "0"; document.body.appendChild(img); } let [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); chrome.scripting.executeScript({ target: { tabId: tab.id }, function: imageappend }); })(); ```