hensm / fx_cast

Chromecast Web Sender SDK implementation for Firefox
https://hensm.github.io/fx_cast/
MIT License
1.87k stars 63 forks source link

Attempting to cast to Chromecasts is greyed out #239

Open CountZeroOr opened 1 year ago

CountZeroOr commented 1 year ago

OS version: Windows 11 Browser version: Firefox 105.0.1 (64-bit) Extension version: 0.3.1 Bridge version: Not sure

Description The extension can successfully pull up a list of compatible devices when attempting to cast video from Firefox to a Chromecast with Google TV. However, when I attempt to click on a device, nothing happens. Right-clicking on a device gives an option to cast to that device, but it is also greyed out.

Steps to reproduce

  1. Open a YouTube video in Firefox
  2. Click the icon for the fx_cast extension in the toolbar.
  3. Attempt to select a device to cast to.

Expected behaviour After opening a video in Firefox, I expect to be able to select the device and start casting the video.

Logs Provide any applicable logs here. Info on where to find them is located here.

hensm commented 1 year ago

Can you confirm whether YouTube is whitelisted and detected as a sender app?

Should look like this: youtube

CountZeroOr commented 1 year ago

It is whitelisted, but it doesn't appear to be detecting as a sender app.

hensm commented 1 year ago

Looks like YouTube isn't loading the Chromecast library. Have you set a user agent override or do you have any other extensions that could be interfering with the user agent string?

Check the value of navigator.userAgent in the web console in a YouTube tab. It should be:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/104.0.0.0 Gecko/20100101 Firefox/103.0"

CountZeroOr commented 1 year ago

I'm not seeing anything for that in the web console, when I filter by navigator.userAgent.

hensm commented 1 year ago

You need to evaluate it to get the value. Enter it in the command line at the bottom. console

CountZeroOr commented 1 year ago

Ah. Result is "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0", so it doesn't have the Chrome part.

hensm commented 1 year ago

I'd suggest testing with a fresh profile. Presumably there's something about your config that's conflicting here. Without the custom user agent, YouTube doesn't know to enable cast functionality.

CountZeroOr commented 1 year ago

Same result on a fresh profile.

hensm commented 1 year ago

Same result on a fresh profile with fx_cast installed and YouTube whitelisted? I'm not really sure what would be causing this.

Is this just YouTube or does it affect other whitelisted sites? Maybe try checking for error logs in the extension toolbox console in case it's a weird bug in the request handler code: https://extensionworkshop.com/documentation/develop/debugging/#developer-tools-toolbox

CountZeroOr commented 1 year ago

It's impacting other whitelisted sites. When I checked the error logs for the extension, I got these errors:

fx_cast (Error): Failed to find option siteWhitelistCustomUserAgent in storage. background.js:1:31987 fx_cast (Error): Failed to find option siteWhitelist in storage. background.js:1:31987 Uncaught (in promise) Error: fx_cast (Error): Failed to find option siteWhitelist in storage. error moz-extension://dd39b224-d5f3-4b6c-befa-b33daeaf7079/background/background.js :1 get moz-extension://dd39b224-d5f3-4b6c-befa-b33daeaf7079/background/background.js :1 background.js:1:31996 fx_cast (Error): Failed to find option siteWhitelist in storage. background.js:1:31987 Uncaught (in promise) Error: fx_cast (Error): Failed to find option siteWhitelist in storage. error moz-extension://dd39b224-d5f3-4b6c-befa-b33daeaf7079/background/background.js :1 get moz-extension://dd39b224-d5f3-4b6c-befa-b33daeaf7079/background/background.js :1

On Wed, Sep 28, 2022 at 7:38 PM Matt Hensman @.***> wrote:

Same result on a fresh profile with fx_cast installed and YouTube whitelisted? I'm not really sure what would be causing this.

Is this just YouTube or does it affect other whitelisted sites? Maybe try checking for error logs in the extension toolbox console in case it's a weird bug in the request handler code:

https://extensionworkshop.com/documentation/develop/debugging/#developer-tools-toolbox

— Reply to this email directly, view it on GitHub https://github.com/hensm/fx_cast/issues/239#issuecomment-1261668912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKFMDRSPWINH5GT6MLOCMWLWAT6MDANCNFSM6AAAAAAQXVNNO4 . You are receiving this because you authored the thread.Message ID: @.***>

-- Alexander Case Associate Editor for Bureau42.com http://www.bureau42.com Host of "Breaking it all Down" & "The Nintendo Power Retrospectives" on YouTube https://www.youtube.com/user/CountZeroOr

hensm commented 1 year ago

Interesting, not seen that before. Well, that's definitely an extension bug. It'd be great to be able to reproduce this. Does this happen in a fresh profile?

Would be useful to see the current options values, if you could run this in the extension toolbox console: JSON.stringify(await browser.storage.sync.get())

CountZeroOr commented 1 year ago

Current options values are: "{\"options\":{\"bridgeApplicationName\":\"fx_cast_bridge\",\"bridgeBackupEnabled\":false,\"bridgeBackupHost\":\"localhost\",\"bridgeBackupPort\":9556,\"localMediaEnabled\":true,\"localMediaServerPort\":9555,\"mediaEnabled\":true,\"mediaOverlayEnabled\":true,\"mediaStopOnUnload\":false,\"mediaSyncElement\":true,\"mirroringAppId\":\"19A6F4AE\",\"mirroringEnabled\":false,\"receiverSelectorCloseIfFocusLost\":true,\"receiverSelectorType\":0,\"receiverSelectorWaitForConnection\":true,\"userAgentWhitelist\":[\"https://www.netflix.com/*\",\"https://www.youtube.com/*\",\"https://www.twitch.tv/*\",\"https://www.twitch.tv/*\",\"*://www.twitch.tv/*\"],\"userAgentWhitelistEnabled\":true,\"userAgentWhitelistRestrictedEnabled\":true}}"

CountZeroOr commented 1 year ago

I'm not getting the error messages in a clean profile, and I do appear to be able to cast.

hensm commented 1 year ago

For some reason, the upgrade didn't update the options properly. Uninstall and reinstall the extension and it will reset them and fix it.

I'll do some testing to see why the upgrade failed.

CountZeroOr commented 1 year ago

It is currently working with the reinstallation.

jed84 commented 1 year ago

It is currently working with the reinstallation.

For some reason, it doesn't work for me. Creating a new profile or reinstalling the Firefox extension does not resolve the problem.

@hensm My user agent is as follows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/104.0.0.0 Gecko/20100101 Firefox/103.0"

Browser version: Firefox 106.0.1 (64-bit) Extension version: 0.3.1 Bridge version: 0.3.0 OS: Win 11 22H2

CountZeroOr commented 1 year ago

I believe I just reinstalled the extension.

Alexander Case

E: @. @.) W: http://countzeroor.com

On Oct 20 2022, at 6:20 pm, jed84 @.***> wrote:

It is currently working with the reinstallation. For some reason, it doesn't work for me.

Did you only reinstall the FF extension? — Reply to this email directly, view it on GitHub (https://github.com/hensm/fx_cast/issues/239#issuecomment-1286337472), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AKFMDRUGNVDOBH2GK5HNFTLWEHVVFANCNFSM6AAAAAAQXVNNO4). You are receiving this because you authored the thread.

jed84 commented 1 year ago

The extension does work with Spotify, but I can't make it work with (examples) YouTube, Daily Motion or All 4.

jed84 commented 1 year ago

@hensm Can I please have your help on this one?

hensm commented 1 year ago

@jed84 It sounds unrelated to this issue. Submit a new issue with some more info (logs if possible) and I'll take a look.

MalcolmMielle commented 1 year ago

Similar to @jed84 I get it to work with youtube but not deezer

hensm commented 1 year ago

Similar to @jed84 I get it to work with youtube but not deezer

Seems to rely on a stubbed cast API method. https://github.com/hensm/fx_cast/issues/279