I am trying to develop a chrome extension that can click on an absolute position in all tabs. Things are going really well, but I've run into one major problem that prevents me from packing this up and calling it a day.
I am running this code: document.elementFromPoint(600, 303).click();
with Chrome executeScript, I can do this on every tab and it works great.... as long as the page is pure HTML...
chrome.tabs.query({}, function (tabs) {
for (var i = 0; i < tabs.length; i++) {
chrome.tabs.executeScript(tabs[i].id, {code: 'document.elementFromPoint(600, 303).click();'});
}
}
);
So here's the problem: Some of the pages that I want to run this on are not pure HTML and I'm doomed. I think that this approach has problems when it's a javascript page because my code appears to evaluate a document page rather than an applet. Either that, or it could be some odd XSS protection or something.
Is there javascript code or a chrome API that will allow me to simulate a left mouse click at a position in a tab regardless of what is loaded in there?
I'd appreciate any help if someone knows. I have been racking my brain for weeks. Nothing works.
Thanks.