nextcloud / bookmarks

🔖 Bookmark app for Nextcloud
https://apps.nextcloud.com/apps/bookmarks
GNU Affero General Public License v3.0
1.01k stars 173 forks source link

Add bookmark dialog hangs when triggered from Bookmarklet and using Firefox Multi-Account Containers #1170

Open reimer-atb opened 4 years ago

reimer-atb commented 4 years ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Install Firefox Multi-Account Containers extension
  2. Configure it to always open your Nextcloud instance in container "A" and "some other page" in container "B".
  3. Logout of Nextcloud
  4. Open "some other page"
  5. Use the Bookmarklet to add a new bookmark for "some other page"
  6. You are redirected to Nextcloud Login screen
  7. Login with your Nextcloud username and password - I also use 2FA with a FIDO2 key
  8. After successful login you are redirected to the "Add bookmark" form
  9. Click Save
  10. A spinning circle appears next to the "Add Bookmark" heading but you remain on the page with the "Add bookmark" form. If you manually go to the bookmarks app your new bookmark will be listed there. So saving the bookmark actually works.

If you try to bookmark a page that is open in the same container "A" as your Nextcloud instance, then the Nextcloud login page and "Add bookmark" page will appear in a popup instead of a full-sized tab. After clicking save, the popup is automatically closed.

Expected behavior After bookmark was successfully saved the user should be redirected to the Bookmarks App's page and see her new bookmark listed there. Or if that is not the intended behaviour of the "Add bookmark" page then maybe just close the page.

Screenshots

Desktop (please complete the following information):

Server (please complete the following information):

Additional context Add any other context about the problem here.

Web server error log

Insert your webserver log here

Nextcloud log (nextcloud/data/nextcloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...
marcelklehr commented 4 years ago

Confirmed. The reason for this is that the code tries to close the window once the bookmark is created. Firefox Containers forces the window to be opened in a tab, however, which cannot be closed programmatically. So, the best solution, IMO, would be to also display a success message, so the user is not left hanging in the balance.

marcelklehr commented 4 years ago

the code for the bookmarklet is here: https://github.com/nextcloud/bookmarks/blob/master/src/components/ViewBookmarklet.vue#L153