Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add other means of identifying a service #1882

Open
SkyLeite opened this issue Jan 28, 2019 · 14 comments · May be fixed by #4434
Open

Add other means of identifying a service #1882

SkyLeite opened this issue Jan 28, 2019 · 14 comments · May be fixed by #4434
Labels
core This issue or pull request is related to the extension core feature New feature or request

Comments

@SkyLeite
Copy link
Contributor

Is it possible to add an option for connectors to identify a service through means other than the website's URL? It would make adding support for self-hosted platforms such as https://funkwhale.audio, which are not tied to a specific pattern or URL, but work consistently across all of them.

@inverse
Copy link
Member

inverse commented Jan 28, 2019

We provide the ability to change the URL for a given connector. See https://github.com/web-scrobbler/web-scrobbler/wiki/Custom-URL-patterns

Is that sufficient?

@inverse inverse added feature New feature or request core This issue or pull request is related to the extension core labels Jan 28, 2019
@SkyLeite
Copy link
Contributor Author

It works in the short term, but I think ideally it's best to have something like having the extension look for certain meta tags to automatically identify such services.

@inverse
Copy link
Member

inverse commented Jan 28, 2019

This has been mentioned before. Perhaps it's time to start implementing some Dom parsing matcher as an experimental feature for this.

@agateblue
Copy link

Hi, Funkwhale maintainer here :)

If needed, I can easily add a meta tag into Funkwhale HTML, like <meta name="generator" content="funkwhale 0.18">. I'm not sure how the actual scrobbling work though. How does Web Scrobbler identifies that the player switched to another track? If I can help with that, let me know!

@inverse
Copy link
Member

inverse commented Jan 29, 2019

Hey @EliotBerriot - thanks for reaching out. Once we start implementing this feature I can imagine that'll be useful for injecting the correct logic into the page.

The scrobbling normally works by binding to DOM elements and watching for changes. e.g. like this: https://github.com/web-scrobbler/web-scrobbler/blob/master/src/connectors/mnet.js

Sometimes even binding to native audio elements or the JS that the apps expose.

@agateblue
Copy link

The scrobbling normally works by binding to DOM elements and watching for changes. e.g. like this: https://github.com/web-scrobbler/web-scrobbler/blob/master/src/connectors/mnet.js

Makes sense, I'll try to keep stable class names for artists / albums / track data then!

@alexesprit
Copy link
Member

I've added a basic support for identifying websites via checking for match rules in a content script. Will merge these changes into master branch after some testing and extending the match rules.

@alexesprit
Copy link
Member

@EliotBerriot would be great if you add a meta tag like you suggested. I think it should contain no version:

<meta name="generator" content="Funkwhale">

as the version is redundant here (can be added as a separate meta tag, though).

@agateblue
Copy link

@alexesprit, sure, I'll do that today, and it will be included in our next release :)

@agateblue
Copy link

@alexesprit So it's been implemented, and deployed at https://open.audio/library if you want to try it. Let me know if you need me to set some static classes / attributes on the player to make the job easier for you :)

@stephanebruckert
Copy link
Contributor

Can we find a method to do this with the Spotify and Bandcamp embeds as well? These are still open/unmerged:

@alexesprit
Copy link
Member

@stephanebruckert the way I added should work for embeds in theory, but I haven't checked it.

There're some known limitations:

  • It doesn't work in websites that add embeds dynamically (e.g. reddit, where a post with an embed can be loaded while scrolling posts).
  • It doesn't work in websites that already covered by another connector.

@inverse
Copy link
Member

inverse commented Jun 24, 2020

@alexesprit did you make any progress on this injection mechanism?

@alexesprit
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core This issue or pull request is related to the extension core feature New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

5 participants