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

Official Plugin API #20669

Open
hiddeninthesand opened this issue Jan 21, 2022 · 5 comments
Open

Official Plugin API #20669

hiddeninthesand opened this issue Jan 21, 2022 · 5 comments
Labels
A-Developer-Experience A-DevTools /devtools, show hidden events, etc. O-Uncommon Most users are unlikely to come across this or unexpected workflow T-Enhancement

Comments

@hiddeninthesand
Copy link

Your use case

What would you like to do?

An official plugin/modification API similar to BetterDiscord which would allow expanding the functionality of Element in a much more dynamic way than committing directly to the project.

Why would you like to do it?

Electron was built specifically to be easily modifiable by the user, ever since it was Atom Shell, and eventually renamed to Electron. Many other projects, rather officially or not, make good use of this, such as previously mentioned BetterDiscord. Many features that some people may want are rather too niche or not worth the Element developers' time to justify adding to the main Element client, such as automatic message translation, advanced GUIs for search and room management, or a reimplementation of Discord's emoji system (all notable BD plugins). An upside that may be more important to the Element developers is that if this catches on, it'd be an easy way to gauge what features people do want added to the main project via plugin popularity.

How would you like to achieve it?

Possibly the same way BetterDiscord does it, an injector with plugin script files. If BD is anything to go by, if you give people a way to modify a client, they will modify a client.

Have you considered any alternatives?

There are really only three alternatives to this, and all of them are less than ideal.

Unofficial Injector

The best of these would be to make an unofficial plugin injector, and while that is perfectly functional, especially since as an open source project I imagine the developers would be more likely to play ball with the maintainers of an unofficial injector to ensure stability, this would guarantee some loss of stability and security. This specific example is not a bad alternative, but it's certainly not the best one.

Contributing directly to the Element project

This comes with many more issues, including but not limited to being more difficult to create (as it would obviously come with more stringent security and stability criteria than a user modification), being less likely to be approved at all (too niche for the main project/out of scope), or simply because it'd make the project bigger than it has to be. Not ideal for users, developers, or the Element project maintainers.

Forking Element

The worst option of them all, as it'd mean minor changes would be forced to be maintained on an entirely separate fork of Element, with no upstream improvements likely to come, and being even more difficult for a would-be plugin developer or plugin user than the other two. It's very rare that someone who wants to modify a client would prefer to have to maintain their own version of said client.

Additional context

This issue is related to #15650, which was previously closed as the specific examples the OP submitted could be done using an alternative (a local service). I'd like to make clear that the specific examples I've listed are not the only reason I'd like such a thing to exist, and if you require more examples there's an official list of BetterDiscord plugins that contain popularity statistics to further my case here.

@dbkr dbkr added the O-Uncommon Most users are unlikely to come across this or unexpected workflow label Jan 21, 2022
@SimonBrandner SimonBrandner added A-Developer-Experience A-DevTools /devtools, show hidden events, etc. labels Jan 22, 2022
@sweidac
Copy link

sweidac commented Dec 13, 2022

I would love to see this feature. Our use-case would be a plugin for the company which could e.g. generate links to our Jitsi server, or insert some funny GIF sourced from some company insider jokes.
I just want to emphasize the point that such things are out-of-scope of the main repo.

@t3chguy
Copy link
Member

t3chguy commented Dec 13, 2022

@sweidac both of those can be done using Widget integrations and Bots already today.

@sweidac
Copy link

sweidac commented Dec 15, 2022

Sounds nice @t3chguy! Unfortunately I couldn't find documentation about Widget's after excessive querying the web (my fault most probably). Can you provide a link to some resources?

@0xdevalias
Copy link

0xdevalias commented Dec 29, 2022

both of those can be done using Widget integrations and Bots already today.

This was my thought as well.

Unfortunately I couldn't find documentation about Widget's after excessive querying the web

I've also tried a few times to find good info/resources on this, and I keep struggling to do so. Would love to see the official/comprehensive/etc docs for it!

The best I've found (that I can remember off the top of my head) has just been searching the issues here for 'widget' and combing through the disparate threads to try and get snippets of info:

Edit: Based on that, here are a few relevant snippets i've (re-)discovered just now:

And from Google/etc:

@PseudoResonance
Copy link

A potential use-case outside the scope of Element may be file compression. Because of Discord's abysmal 8MB upload limit, I threw together a BetterDiscord plugin to compress images, video and audio automatically (using FFmpeg for the video/audio) which is extremely helpful. Even with the increased upload sizes today, I like to use it to quickly normalize audio files or clip video I send when I share things, and it would be great to have similar functionality on Element.

Maybe it would be appropriate to have a simplified version of it built into Element with a hidden advanced menu for all the other stuff? But I think it's probably better suited to being an optional plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience A-DevTools /devtools, show hidden events, etc. O-Uncommon Most users are unlikely to come across this or unexpected workflow T-Enhancement
Projects
None yet
Development

No branches or pull requests

7 participants