regseb / castkodi

WebExtension to cast videos and music to Kodi.
MIT License
104 stars 24 forks source link

Right-click->cast link with a '/' inside tags sends title instead of URL #79

Closed iamsix closed 2 years ago

iamsix commented 2 years ago

Describe the bug

When you right click > Cast to Kodi on a link that has a / in its title tag ie:

<a href="example.com">link with / in it</a> would cause the extension to send "link with / in it" to kodi instead of "example.com"

To Reproduce

Steps to reproduce the behavior:

  1. right click on r/Place Pixel Art Error, BUT IRL
  2. Choose 'Cast to Kodi' > Play Now

Expected behavior

Kodi should play that youtube video

Screenshots (if appropriate)

Kodi will error, according to the logs it's because it tries to send the title as the URL: 2022-04-03 19:19:08.671 T:1232 ERROR <general>: CCurlFile::Stat - Failed: Couldn't resolve host name(6) for http://r/Place%20Pixel%20Art%20Error,%20BUT%20IRL

Environment

regseb commented 2 years ago

I don't reproduce the bug. I tested with Chromium 100 (on Ubuntu) and the video plays in Kodi. I also tested with a touch screen and it works. 🤔

I only get the error by:

  1. selecting the link text;
  2. right-click on the selected link text;
  3. Cast to Kodi > Play now.

In this case it's normal because Cast Kodi first checks if the selected text is an address (and a slash is enough because the address is prefixed with "http://" if necessary). If it's an address, then it's sent to Kodi. Otherwise it's the URL of the link that is sent.

What is your Cast Kodi configuration (especially the checkboxes and radio buttons)?

iamsix commented 2 years ago

Setup is one server - default everything else except I think the playlist thing I have set to 'cast only the video'

From what you say about highlights however I suspect it's actually something this chromebook is doing with chrome. Whenever I right-click on a link it also highlights the link test, a rather annoying feature that I wish I could turn off, but apparently the flag to disable it has been removed in newer versions.

I tried turning off the "Selection" checkbox to see if it would send the link but it still sends the text.

regseb commented 2 years ago

There is a bug in Cast Kodi when the Selection checkbox is off. The selected text should not be analyzed. I will try to fix this problem.

When the Selection checkbox is on and you just right click on a link: the link should be sent. I think the bug comes from Chrome on ChromeOS. You should open an issue on Chromium tracker tool.

regseb commented 2 years ago

The new version 6.5.0 of Cast Kodi fixes selected text bug when Selection checkbox is off. But there is still the bug when the Selection checkbox is on in ChromeOS. 😞