fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.38k stars 345 forks source link

Item links no longer open in new window (2.19 regression) #1304

Closed deathbybandaid closed 2 years ago

deathbybandaid commented 2 years ago

Many feeds contain descriptions with clickable images such as:

<description><a href="https://www.youtube.com/watch?v=jP0IXzgRnak"><img alt="Youtube" src="https://i.ytimg.com/vi/jP0IXzgRnak/maxresdefault.jpg"></a></description>

In Selfoss 2.18, clicking the image opens the href link in a new browser tab. Whereas, in Selfoss 2.19, the link opens in the same tab as Selfoss itself.

I personally leave Selfoss open while at work, so this behavior is undesirable (for me). Maybe besides credentials, there could be user-based settings for how these are handled, or a global config property? Or if assuming my desired behavior for this is what most people would prefer, then that could be the primary behavior?

jtojnar commented 2 years ago

There are two different variants of clickable images:

You can distinguish them since item content/description will only show after expanding the item, whereas thumbnails will be always visible. Unless you set show_thumbnails=0 in which case they will behave identically. Then you might want to check in the web browser developer tools whether the link is inside <div> with class entry-thumbnail or entry content.

deathbybandaid commented 2 years ago

I'll have to look at how I create my feeds, I just noticed this as a change from 2.18 to 2.19

deathbybandaid commented 2 years ago

Just looked at a random github release feed (Jackett).

This (like many other projects) link commits in the release thread.

Within Selfoss 2.18, clicking these opens them in a new tab, where 2.19 opens within the same tab, and I have to use my browsers back function/button to get back to Selfoss.

This looks to affect all links and not just the ones hiding behind images.

image

jtojnar commented 2 years ago

Weird. I do not remember it doing that. But I have always used latest dev version and always use middle mouse button. Will try to verify.

deathbybandaid commented 2 years ago

I'm simultaneously running 2.18 to test things back and forth.

jtojnar commented 2 years ago

Yeah, I will need to check the source code why it behaved that way. Maybe we opened all links using window.open.

jtojnar commented 2 years ago

Yeah, probably this code:

https://github.com/fossar/selfoss/blob/2.18/public/js/selfoss-events-entriestoolbar.js#L9-L14

jtojnar commented 2 years ago

It should be as simple as adding a.setAttribute('target', '_blank'); to https://github.com/fossar/selfoss/blob/77dedc11ffb24301fd268451977e2fe2a6a2c121/assets/js/templates/Item.jsx#L42

But will need to think about if we always want that or should make it configurable. If one wants to open a link in new tab they can always use a middle mouse button. But if we reverted to the previous behaviour and the user wants to leave selfoss, they can no longer use left mouse button for that. Or maybe the left/middle button will still carry the distinction of opening the page in foreground/background and if we added a configuration option no-one would use it.

deathbybandaid commented 2 years ago

I'd say configurable would be the best route to go. Unfortunately the middle click on my mouse at home doesn't work half the time, and I'm too cheap to buy a new mouse :)

deathbybandaid commented 2 years ago

waiting for cloudsmith to publish the new archive, but again, thanks for your typical fast responses!

jtojnar commented 2 years ago

I hate mouse producers that cheap on middle buttons, I already had to RMA my current mouse after two months of use and it has been five months and the mouse wheel starts to bug again :rage:

For now, I returned the 2.18 behaviour. We can make it configurable if someone wants the 2.19 behaviour.

jtojnar commented 2 years ago

Thank you for reporting the all discrepancies you find. It has been so long I used 2.18 I might not notice a regression.

deathbybandaid commented 2 years ago

No problem,,, looks like there's some checks not passing for that commit, so no cloudsmith update

jtojnar commented 2 years ago

Ugh, GitHub is failing again with Error 500. Re-ran the action, hoping it was just transient. Unfortunately, GitHub has been steadily becoming less and less stable in the past two years.

jtojnar commented 2 years ago

Third time's the charm. Holding my thumbs.

deathbybandaid commented 2 years ago

Just grabbed 2.19-6decc7c and it works perfectly, Thanks!

It's no problem for me to report stuff. I use Selfoss as much as I use Plex Media Server, and I would never expect fixes/changes without doing an issue thread.