Why does a js-generated click on a link with target="_blank" open a new, chromeless window when a user click on the same link opens in a new tab (the desired behavior, and expected with my current browser settings)?
Context: I use the Feedly web app to read RSS feeds, and just tried writing a super-simple bookmarklet to open all the links in a current category in new tabs:
(function () {
function main() {
var links = document.querySelectorAll('#timeline .condensedTools a:first-child');
for(var i = 0; i < links.length; i++){
var link = document.createElement('a');
link.href = links[i].href;
link.target = '_blank';
document.querySelector('body').appendChild(link);
link.click();
}
}
main();
})();
I only really care about Chrome for this at the moment, so haven't looked anywhere else. I suppose the browser's approach to popup-ad blocking is forcing a different behavior on these links even though I've expressly allowed popups on this particular site. But is there any way around it for a user-executed script?