browser-mpris2 icon indicating copy to clipboard operation
browser-mpris2 copied to clipboard

Installation instructions for Firefox?

Open BobbyWibowo opened this issue 5 years ago • 13 comments

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.

BobbyWibowo avatar Aug 10 '18 01:08 BobbyWibowo

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

otommod avatar Aug 15 '18 21:08 otommod

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

mmhobi7 avatar Aug 25 '18 22:08 mmhobi7

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 avatar Sep 04 '18 12:09 cbix

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

To install run native/install-firefox.py "[email protected]" 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"

cbix avatar Sep 07 '18 23:09 cbix

@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 :) )

stuaxo avatar Sep 20 '18 12:09 stuaxo

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

mmhobi7 avatar Sep 20 '18 12:09 mmhobi7

@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? ;)

cbix avatar Sep 20 '18 12:09 cbix

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

mmhobi7 avatar Sep 20 '18 12:09 mmhobi7

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:

BobbyWibowo avatar Sep 30 '18 01:09 BobbyWibowo

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.

pschiffe avatar Feb 05 '19 04:02 pschiffe

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

SpineEyE avatar Mar 02 '19 13:03 SpineEyE

Just signed and uploaded the latest master. native/install-firefox.py "[email protected]" Download

cbix avatar May 18 '19 15:05 cbix

Hi,

Apparently MPRIS has been integrated to firefox:

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1353652
  • https://hg.mozilla.org/integration/autoland/rev/e7e12a4881b8

More info:

  • https://docs.google.com/document/d/1c4FivJpvAjjw9Uw-jn7X1UjGOoWkANXOulNyqDWs83w/edit#bookmark=id.pib0vhqfh6hi

Setting config keys worked for me:

  • media.hardwaremediakeys.enabled=true
  • dom.media.mediasession.enabled=true

Found the info on another project:

  • https://github.com/jsmnbom/mpris-integration/issues/9

sygour avatar Jul 06 '20 09:07 sygour