Clipboard extension support on liluo.io or online servers

Hello,

after having a conversation about it in this forum (in which the Clipboard extension’s author arthuro555 also participated), I found out that there is no way to use the clipboard extension in online html5 browser games.

arthuro55 explained that that is because the hosting site of the online game needs to provide a Secure Context and in his own words:

However after testing, I found out that the clipboard extension does not work even on Gdevelop’s own hosting site liluo.io.
(for reference when using Clipboard extension 1.0 on liluo.io inside a game:
writing to clipboard writes nothing to clipboard.
reading from clipboard returns ‘0’)

So my feature suggestion would be
1.) for liluo.io to provide the secure context necessary to allow copy pasting, since this is Gdevelop’s own platform and should allow for Gdevelop extensions to run.
2.) if necessary add a possibility to the clipboard extension to run a pop up window that asks for explicit permission to access the clipboard.

And at the time being, it would be helpful to add to the clipboard extension description that it is not compatible with html5 games hosted online. Because even if theoretically it is possible, practically you cannot use the clipboard extension on any public hosting platform.

Thanks for reading.

I want to make sure I clarify something on this request, as the above seems to imply a misunderstanding of extensions. Extensions are not officially supported by the GDevelop engine, or company/dev team. The extension list is provided to make things easier for developers, and if they’re on the main (non-community) extension list they have gone through a basic review to ensure they do not break the engine. This does not imply support or endorsement by the GDevelop company or engine itself, just that they’re made available for use.

There are likely dozens of extensions that may not work on Liluo due to fundamental requirements and incompatibilities with HTML and/or mobile development.

That said, I’m also not 100% sure there is a desire to change the iframe policies for Liluo, as enabling this can lead to improper use by malicious parties. I’ll let a team member confirm either/or if they take a look at this.

Edit: To be clear on the above, I’m not saying there won’t be a change. I’m saying I legitimately don’t know if the change would be made, for the above reason.

Yes, I understand.

Just to explain the reason of my request better than I just did:
Gdevelop has Multiplayer Peer-To-Peer functionalities.
Those functionalities are officially supported by the GDevelop engine and part of the official program.
(Even though as far as I understand still partly in experimental state?)
They allow you to create Peer-To-Peer multiplayer games connected online via server brokers.

Now to create a Peer-To-Peer multiplayer game using the officially supported GDevelop functions, the two players have to communicate the generated User ID in order to connect to each other.

This User ID can consist of 36 characters of random letters and symbols.

E.g.:
0bcf1d8b-ab3c-4e53-b891-2a40edec6dc4

There is no way you can expect a user to copy such an ID manually and write it down manually in order to send it to the other users so they can connect!

That’s where normally the Clipboard Extension would come in handy.
You copy the ID to clipboard, and the user easily communicates it with the other users.

This feature is not possible in online games, as described above.
And since Gdevelop is officially a game engine for mobile, Desktop and online html5 games, it would be great if they also support their official peer to peer functions for html5 games.
Because in the current state, you cannot use them without a clipboard functionality.

So for that reason, I think it could be more relevant than just enabling an inofficial extension to run online.
It’s to improve the peer-2-peer functionalities of Gdevelop.
Unless peer-2-peer gets to a point where communicating the ID’s won’t be necessary.

Sorry for a lengthy explanation.

And thank you for asking a team member to look at this.

I will check out arthuro’s (inofficial I suppose) multiplayer extension, which also seems pretty epic and I just found out existed. It does not require to communicate a lengthy ID, and so I hope it’ll work.

No worries, I totally follow the reasoning, I just wanted to ensure to clarify in this thread for you (and anyone that finds it) that extensions aren’t supported by the Gdevelop company/engine team, and dev decisions usually aren’t made around compatibility with them. The logic for why you’d want the change is sound.

This already exists, though of the browser see you doing it on a forbidden context it won’t even come as far as displaying the permission request popup.

That is really not accurate. It is fully compatible with HTML export AND can be used with multiple hosting platforms. For example, if you host your game on netlify, then it will work flawlessly. I’d have to check but I think it also works on gamejolt. I do not think it is fair to say that the HTML5 platform as a whole is unsupported just because two hosting providers are blocking all clipboard accesses from the games.

Note that this is not a rule of P2P: the ID is to be defined by the broker server. If you use a broker server of your own, you can make it generate IDs in whatever way you want, for example with a short word or shorter amount of numbers.

Alternatively, you could use the Text Entry object to allow selecting and copying the text as they would on other apps. That is also more intuitive and gives a sense of control to the player. Same for pasting in: just let the user paste it into a text entry. Since that is fully controlled by the user and not an unconditional permanent full-time read-write access to the clipboard, it is not restricted by the browser.

The ID system is not a limitation of GDevelop that can be avoided some day, it’s a core concept of peer to peer communication. You need to tell who you are sending a message to in some way, the machine can’t automagically guess that. If you want a friend’s system where you can search people through their usernames, find their ID this way or something… Well that’s already possible, using for example firebase (many have done so in the past), but that’s up to you to build, it’s not a problem that a networking feature is supposed to tackle.

If you are talking about the THNK Framework, as of now it only supports P2P as a backed and still requires a P2P ID to connect through it. Other networking features also will require some kind of identification of what server you are connecting to - whether a server name, IP address, or something else.

Okay, understood, thank you for the explanation. That’s why I mentioned the peer 2 peer use, which is an official part of Gdevelop and might be more seriously considered for development.

Well I have to come back at that:
netlify is not a game hosting platform. It’s for web applications and web sites.
Using it for your game is probably among the clumsier ways to distribute your online game.
I tested it on game-jolt. It does not work. It responds exactly the same way as itch.io.
So, it could really help developers if you let them know that the clipboard extension does not work on online gaming platforms. It would be a time saver or help them plan on publishing it mobile or desktop.

The broker server I use (I set up my own) allows for a minimum of 20 characters for the generated ID.
So I cannot set it to 4 characters to make it usable.

Do you have experience with different broker server sites?
It’s a non commercial project, so I do not want to pay for the broker site.
Are there free cloud platforms for broker servers that allow for 4 characters for generated IDs?

Yes, that was what I meant with not using IDs directly. I will try that out.

Well absolutely, that would be way more intuitive! But how is that possible? Gdevelop does not allow Text entry or text objects to allow selecting and copying the text.
Are you suggesting that I program my own text entry objects or use functionalities available directly in pixi.js?

I believe @arthuro555 meant the new Text Input object.

That works.

Since this allows you to copy paste inside online browser games, this feature request I made is unnecessary.

Thank you for the information arthuro555 and thank you for your help, silver-streak.

1 Like