I have a browser extension that takes a screenshot of the visible page (using the browser's API).
The user initiate the process by a custom context menu, injected into webpages.
wrapper.addEventListener("contextmenu", function(e) {
//prevent default context menu
e.preventDefault();
menu.style.display = "block";
});
menu.addEventListener("click", function click(e) {
e.preventDefault();
e.stopPropagation();
//prevent the appearance of the menu in the screenshot
menu.style.display = "none";
capture();
}, false);
The problem is that the menu is still visible in the screen capture. Is there a way to detect when the style changes are reflected ?
Thanks.