freetube-redirect icon indicating copy to clipboard operation
freetube-redirect copied to clipboard

Does not work on Linux

Open ilu33 opened this issue 6 years ago • 15 comments

The addon does not work (at least not on Debian9 Linux). It tries to open the freetube:// link in a browser window which results in a "adress not known, no registered protocol" message - which is correct, the protocol is not registered in firefox.

I can't find any addon code that registers the protocol. Is that code integrated in freetube? That would be a design flaw since freetube can't know which browser profile is located where and which browser profile has the addon.

I could try to debug if you pointed me to the code that actually registers the protocol with firefox. Edit: I've found code in https://github.com/FreeTubeApp/FreeTube/blob/development/src/js/init.js but that's only working inside freetube, isn't it? I think you at least missed this: https://github.com/electron/electron/issues/4857#issuecomment-201124281 while configuring the deb file. I don't know whether this takes care of the problem inside firefox.

I still think the addon should register the protocol in the browser profile where the addon is installed (and only there). Which I think is what was suggested here: https://github.com/FreeTubeApp/FreeTube/issues/44#issuecomment-396980988

ilu33 avatar Nov 04 '18 16:11 ilu33

The protocol handler is registered via the desktop file on Linux. (at least on Gnome)

So adding MimeType=x-scheme-handler/freetube; to the freetube.desktop file will make the extension work.

So it should look something like this:

[Desktop Entry]
Name=FreeTube
GenericName=YouTube Player
Comment=An open source desktop YouTube player built with privacy in mind.
Exec=freetube %U
Terminal=false
Type=Application
Icon=freetube
Categories=Network;
MimeType=x-scheme-handler/freetube;

After adding the line to the desktop file one should run update-desktop-database from a terminal or restart the session/computer to activate the protocol.

filipkemuel avatar Mar 30 '19 08:03 filipkemuel

Doesn't work for me either. Ubuntu 18.04 in Brave (chromium based) browser. I click youtube links and it opens as normal in the browser. The extension seemingly does nothing. I have Freetube desktop app installed via Flatpak.

Ronkn avatar Dec 04 '19 03:12 Ronkn

The protocol handler is registered via the desktop file on Linux. (at least on Gnome)

So adding MimeType=x-scheme-handler/freetube; to the freetube.desktop file will make the extension work.

So where do I find this freetube.desktop file? Ubuntu 18.04 Gnome DE

Ronkn avatar Dec 04 '19 03:12 Ronkn

@boggle247 It depends on how you installed FreeTube.

If installed as a normal system package via your package-manager be in: /usr/share/applications

It might be named differently depending on how it was packaged.

If you installed it as a flatpak it should be in either: ~/.local/share/flatpak/exports/share/applications (for user-installed flatpak) or: /var/lib/flatpak/exports/share/applications (for system-installed flatpak) With flatpak the desktop file is called: io.freetubeapp.FreeTube.desktop

You can copy the file to ~/.local/share/applications and then edit it. This should ensure that the edit persists through updates.

However this shouldn't be necessary anymore, at least for the flatpak, since the MimeType-line has already been added upstream.

The app works for me now even without changes. I don't use brave but downloaded it, installed the extension and it worked like it should on my machine.

filipkemuel avatar Jan 20 '20 16:01 filipkemuel

@filipkemuel I'll give this a shot

Ronkn avatar Jan 20 '20 17:01 Ronkn

@filipkemuel Adding MimeType=x-scheme-handler/freetube; to the desktop file does work indeed, but FreeTube doesn't seem to handle the freetube:// scheme correctly. The application sets the search bar input to "freetube-bin" and nothing more seems to happen. I'm running Arch and installed FreeTube from the AUR.

EDIT: I managed to make it work : I had configured Firefox to run the freetube binary (which firefox suggested by default). Under Preferences -> General -> Applications I changed it to use xdg-open instead, now everything works fine !

ShellCode33 avatar Feb 01 '20 03:02 ShellCode33

It now seems to work fine without tweaks. As someone above mentioned about a fix added upstream, perhaps this is what solved it.

Ronkn avatar Feb 01 '20 14:02 Ronkn

Adding MimeType=x-scheme-handler/freetube let me opens only the application, but not the video

sith-on-mars avatar Mar 07 '20 19:03 sith-on-mars

@filipkemuel Adding MimeType=x-scheme-handler/freetube; to the desktop file does work indeed, but FreeTube doesn't seem to handle the freetube:// scheme correctly. The application sets the search bar input to "freetube-bin" and nothing more seems to happen. I'm running Arch and installed FreeTube from the AUR.

EDIT: I managed to make it work : I had configured Firefox to run the freetube binary (which firefox suggested by default). Under Preferences -> General -> Applications I changed it to use xdg-open instead, now everything works fine !

This worked perfectly for me! To those wondering, to change to xdg-open, click on 'use other' and select /bin/xdg-open

WillPower3309 avatar Apr 08 '20 15:04 WillPower3309

@filipkemuel Adding MimeType=x-scheme-handler/freetube; to the desktop file does work indeed, but FreeTube doesn't seem to handle the freetube:// scheme correctly. The application sets the search bar input to "freetube-bin" and nothing more seems to happen. I'm running Arch and installed FreeTube from the AUR. EDIT: I managed to make it work : I had configured Firefox to run the freetube binary (which firefox suggested by default). Under Preferences -> General -> Applications I changed it to use xdg-open instead, now everything works fine !

This worked perfectly for me! To those wondering, to change to xdg-open, click on 'use other' and select /bin/xdg-open

I changed the setting to xdg-open. Unfortunately it's still the same. The apps opens, but doesn't jump to the video link.

sith-on-mars avatar Apr 13 '20 16:04 sith-on-mars

Unfortunately ive had the same observation as @stevenfang1997, for me the app loads the video if it is already open but if the link runs the app it will not load the video

WillPower3309 avatar Apr 16 '20 04:04 WillPower3309

I have some new observations. I added MimeType=x-scheme-handler/freetube in the desktop file, and changed the Firefox preference to xdg-open. After opening a Youtube link, I saw a error message "File not found: freetube://(link to the Youtube Video)".

I'm using freetube-bin from AUR repository.

sith-on-mars avatar Jun 23 '20 17:06 sith-on-mars

According to the app developer, this problem seems to exist exclusively in the AUR and portable versions. In the non AUR and portable versions, you just need to disable "Grab Videos Locally" in the settings and it should be good to go.

sith-on-mars avatar Jun 23 '20 18:06 sith-on-mars

i tried /bin/xdg-open freetube://[URL] in the terminal and doesnt open the video

calm3285 avatar Oct 10 '20 16:10 calm3285

I Added MimeType=x-scheme-handler/freetube; to /usr/share/applications/freetube-bin.desktop and configured Firefox to open freetube protocol with /bin/xdg-open

It still gives me an error Unable to create io-slave. klauncher said: Unknown protocol 'freetube'.

I'm using freetube-bin from AUR repository.

githubtefo avatar Jan 03 '21 22:01 githubtefo