quick-find icon indicating copy to clipboard operation
quick-find copied to clipboard

Cannot open foreground tab

Open lastorset opened this issue 10 years ago • 3 comments

From looking at the code, it seems that opening a foreground tab by holding down Shift should actually be supported. It doesn't work for me, though: nothings happens in either Chrome 46 or Opera 32. I verified that the appropriate branch (evt.shiftKey === true) is taken in text_search.js, and sending the click event should work, so I'm a bit perplexed.

lastorset avatar Nov 05 '15 21:11 lastorset

@lastorset I vaguely remembered implementing this (it's been a while since I've looked at the code). I can't honestly say if it was ever working . I think the issue is that I'm returning false and the event should stop propagating. And having a click event triggered shouldn't open up the link browsers definitely block that.

https://github.com/peterdotjs/quick-find/blob/master/js/text-search.js#L361

Thanks for looking into it. I'll see if this is quick fix so at least shift functionality will be working.

peterdotjs avatar Nov 06 '15 17:11 peterdotjs

I don't think the return value from a setTimeout callback actually is used for anything. I don't know much about the rest, but started reading up a bit on the Chrome Tabs API, which seems relevant, at least.

lastorset avatar Nov 06 '15 23:11 lastorset

I dug some more and it's because the focus is on the parent Div and not on the anchor link itself. Events propagate up and the browser prevents people from manually triggering click events that cause a link or new tab to open. Solution would be to set the focus on the anchor tag. Some refactoring will need to be done to make this happen.

peterdotjs avatar Nov 07 '15 01:11 peterdotjs