my extension is a frame that share the screen with any webpages. I have a button that calls this function(dot.js), but its printing over my frame too. How can i set the area allowed to draw the dots?
dot.js
function printMousePos(event, autor) {
var div = document.createElement("div");
div.style.height = "10px";
div.style.width = "10px";
div.style.backgroundColor = "black";
div.style.position = "fixed";
div.style.left = event.clientX+"px";
div.style.top = event.clientY+"px";
div.style.borderRadius = "50px";
console.log(
"clientX: " + event.clientX +
" - clientY: " + event.clientY);
document.body.appendChild(div);
}
document.addEventListener("mousedown", function(evt){
printMousePos(evt, "autor1");
})
;
Thanks