-
Notifications
You must be signed in to change notification settings - Fork 1
Add "join lobby"-button #39
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
base: main
Are you sure you want to change the base?
Conversation
|
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. |
There was a problem hiding this 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
|
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. |
|
i see this has the same commit regarding auto-loading settings as #34, so that discussion also applies here |
|
We can dynamically ask for permissions depending on which url the user has set in the options. Maybe we could do that instead of using active tab... https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/request |
|
I am currently not happy with the current behavior. I simply adds a join button that is always enabled and visible, regardless of where you are currently connected to the lobby or not. I want it to only be enabled if you are not connected to the lobby already, but to do this in a reasonable way requires that the connection status and state of the extension is handled in a more streamlined way. Im considering rewriting the extension in reefjs as well to handle this (which will also make the browser extension easier to maintain, among other things). So this will probably not be merged any time soon :/ |
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]>
Signed-off-by: Victor Löfgren <[email protected]>
Make our hostname the default host permission. Add all urls as optional permissions so that we can ask for any url dynamically. When a user saves a new url in the options, ask for host permissions on that particular url. Signed-off-by: Victor Löfgren <[email protected]>
Signed-off-by: Victor Löfgren <[email protected]>
|
I actually works, i just want the button to behave the same way as the join/leave button in the extension. To achieve this, the extension needs to send some messages to keep the buttons in sync. The content script cannot access the same local/session storage as the rest of the extension. It should also only be enabled on websites with the same url as have we currently set, and the status needs to be synced if we have multiple websites open currently. I dont know if they will receive these messages or if its only the currently open webpage. Maybe Im trying to make this feature way too complete than it needs to be... It wont make it into the 1.1 release |
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.