otommod / browser-mpris2

Implements the MPRIS2 interface for Chrome and Firefox
92 stars 21 forks source link

Installation instructions for Firefox? #11

Open BobbyWibowo opened 6 years ago

BobbyWibowo commented 6 years ago

Hey, is there any specific installation instructions for Firefox? I kinda assumed just running native/install-firefox.py would do it, but it didn't. It just asked for an extension ID, which I randomly set, but I didn't know what else to do next.

EDIT: I already copied chrome-mpris2 to ~/bin and already confirmed that it was added to $PATH but no improvements.

otommod commented 6 years ago

Sorry for the long delay.

You need to install the extension. Since I have not published the extension on the Firefox Store or however is called, you need to install it as an "unpacked" extension. And here lies the problem, on Firefox those extensions are temporary; once you close your browser they're gone. On Chrome that is not the case. After you do that, you can run native/install-firefox.py with the id of your newly installed extension. That script just tells Firefox how to run chrome-mpris2.

However, you'll need to do that all over again the next time you open Firefox. That's why I have not written instructions for Firefox.

I need to get off my ass and publish the extension...

mmhobi7 commented 6 years ago

@BobbyWibowo https://github.com/Aaahh/browser-mpris2-firefox you can hard code app id with firefox

cbix commented 6 years ago

In Firefox Developer Edition you can go to about:config, set xpinstall.signatures.required to false and then install an unsigned version (.zip) of the extension you built with web-ext build.

p.s. thanks a lot for this extension, found it today and it's just what I was looking for for a long time 😍 I'll try to contribute in the future because some features I'd like to see are missing, like previous/next buttons, open player from the control, music.youtube.com support, ... I'm using it together with https://github.com/andyholmes/gnome-shell-extension-gsconnect to control my browser's youtube player from my phone :)

cbix commented 6 years ago

I built and signed the extension for FF as of commit 3e62f46: Download

To install run native/install-firefox.py "browser-mpris2-3e62f46-signed-fh@cbix.de" and click the link above, done.

Btw, you don't need to publish an extension in order to have it signed, also the verification is automated so it only takes a few seconds:

  1. Generate API credentials here
  2. web-ext sign --api-key="your-api-key" --api-secret="your-api-secret" --id="your-custom-id"
stuaxo commented 6 years ago

@Aaahh any chance of making your changes into a PR so they can be upstreamed ?

Have been using the firefox branch successfully (for all of 5 minutes :) )

mmhobi7 commented 6 years ago

@stuaxo That was the plan but apparently chrome doesn’t like the Id tag I use for firefox

cbix commented 6 years ago

@Aaahh @stuaxo Also I think for future publishing of the extension on the Mozilla addon page we shouldn't use a hardcoded ID, instead it is set when signing as mentioned above.

Maybe @otommod wants to release a mozilla signed package on github? ;)

mmhobi7 commented 6 years ago

I used a hard coded ID for one of my addons, but like that’s a major security risk

BobbyWibowo commented 6 years ago

So you guys really got it working?

Cause like I already built & signed with my own custom ID, used the same ID with install-firefox.py, installed the extension, made sure the ID was correct by manually checking the content of the JSON file that was generated into ~/.mozilla/native-messaging-hosts, made sure the dir containing chrome-mpris2.py was in $PATH (though the JSON file was using the full path), restarted firefox multiple times, tried starting from terminal to look for any error messages, checked web console, but still I couldn't figure out anything. It just stayed silent without doing anything and no related errors/warnings whatsoever.

UPDATE 02/01/2019: Not sure what happened before, it's all good now :ok_hand:

pschiffe commented 5 years ago

Hi, just wanted to let you know that this works for me in Firefox, and it would be great to have the latest version available in Firefox addon store. Thanks for your work.

SpineEyE commented 5 years ago

would be nice if you could publish it on http://addons.mozilla.org :-)

cbix commented 5 years ago

Just signed and uploaded the latest master. native/install-firefox.py "browser-mpris2-7f11327-signed-fh@cbix.de" Download

sygour commented 4 years ago

Hi,

Apparently MPRIS has been integrated to firefox:

More info:

Setting config keys worked for me:

Found the info on another project: