Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Does not work on Linux #5

Open
ilu33 opened this issue Nov 4, 2018 · 15 comments
Open

Does not work on Linux #5

ilu33 opened this issue Nov 4, 2018 · 15 comments

Comments

@ilu33
Copy link

ilu33 commented Nov 4, 2018

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: electron/electron#4857 (comment) 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: FreeTubeApp/FreeTube#44 (comment)

@filipkemuel
Copy link

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.

@Ronkn
Copy link

Ronkn commented Dec 4, 2019

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
Copy link

Ronkn commented Dec 4, 2019

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

@filipkemuel
Copy link

@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.

@Ronkn
Copy link

Ronkn commented Jan 20, 2020

@filipkemuel I'll give this a shot

@ShellCode33
Copy link

ShellCode33 commented Feb 1, 2020

@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 !

@Ronkn
Copy link

Ronkn commented Feb 1, 2020

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

@sith-on-mars
Copy link

sith-on-mars commented Mar 7, 2020

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

@WillPower3309
Copy link

WillPower3309 commented Apr 8, 2020

@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

@sith-on-mars
Copy link

@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.

@WillPower3309
Copy link

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

@sith-on-mars
Copy link

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
Copy link

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.

@calm3285
Copy link

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

@githubtefo
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants