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 "join lobby"-button #39

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add "join lobby"-button #39

wants to merge 3 commits into from

Conversation

l0f3n
Copy link
Contributor

@l0f3n l0f3n commented Jan 17, 2025

Fixes #21

Dynamically adds a join lobby button to the website by the browser extension on the domain specified in wikiweaver server. Hopefully frontend/backend is hosted on the same domain, but we could extend this later if we need that.

Note that you must have the browser extension open on for the permissions to kick in, it wont be able to insert the button otherwise. More on that in the commit message.

image

l0f3n added 2 commits January 17, 2025 14:53
Signed-off-by: Victor Löfgren <[email protected]>
The browser extension will insert a join lobby button on the
wikiweaverserver domain specified by the user. When pressed, this will
join the currently open lobby with stored username. The user most have
specified a username beforehand.

Note: it uses the activeTab permission (instead of permission on
allurls) to be able to insert itself on only the currently active tab.
Thismeans that the user must be on the website and open (or have open)
theextension. The current tab is only part of the activeTab
permissionbased on user interaction, e.g. opening the extension.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#activetab_permission
Signed-off-by: Victor Löfgren <[email protected]>
@l0f3n l0f3n requested a review from sornas January 17, 2025 13:59
@l0f3n
Copy link
Contributor Author

l0f3n commented Jan 17, 2025

This does not interact well with the #36 currently. You need to minimize the extension and then open it again for the join button to appear.

Copy link
Contributor

@sornas sornas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, very cool! i don't have enough time to look at this now but i'll get to it in the weekend

wikiweaver-ext/content/join-lobby.js Outdated Show resolved Hide resolved
@sornas
Copy link
Contributor

sornas commented Jan 19, 2025

ok so it's a bit unfortunate that you have to have the extension loaded to be able to use this button, but it makes sense from a permissions perspective. in the end it's better to have this feature than not. one thing i would like is if the username is saved on every keypress. if no username has been stored, i can't seem to save the username without joining a lobby.

@sornas
Copy link
Contributor

sornas commented Jan 19, 2025

i see this has the same commit regarding auto-loading settings as #34, so that discussion also applies here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a "join lobby" button to the frontend
2 participants