I have made an extension for chrome. It's purpose is to read data from popup window, store that data to database and then close the popup window. Everything is working great but I cannot close the popup window.
My plan is to close the popup window with this code:
$('a.tv-dialog-title-close').trigger('click');
if I type that in to chrome console it closes the popup window nicely, but when I use that exact code in my extension then popup window wont close and I get no errors (weird). Everything else is working just as planned but this one line of code is not working. Anyone, any thoughts ?
Thank you
EDIT:
Got it working with this:
var scriptNode = document.createElement ('script');
scriptNode.textContent = "$('a.tv-dialog-title-close').trigger('click');";
document.body.appendChild (scriptNode);
Thank you Xan