I'm working on a Chrome extension's content script which displays a picture at the bottom of the screen. Right now, my code creates a div but the div isn't showing up when I run the extension.
chrome.runtime.onMessage.addListener(
function(request,sender,sendResponse) {
if(request.requested === "createDiv"){
//code to create div
console.log("hello");
debugger;
var div = document.createElement("div");
div.innerText = "test123";
div.style.position : "fixed";
div.style.bottom : "77px";
div.src = "test.jpg";
document.body.appendChild(div);
sendResponse({confirmation: "job done"});
}
});
Does anyone know why this code isn't working?