Firefox breaks/malforms URLs of some bookmarks
Categories
(Firefox :: Bookmarks & History, defect, P3)
Tracking
()
People
(Reporter: Virtual, Assigned: a.park0324, Mentored)
References
Details
(Keywords: dataloss, nightly-community, reproducible, Whiteboard: [lang=js])
Attachments
(3 files)
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Updated•7 years ago
|
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Updated•7 years ago
|
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Updated•7 years ago
|
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Updated•7 years ago
|
Comment 8•5 years ago
|
||
I'd be happy to mentor this bug. I think the right way to fix this would be to change the code pointed to in comment 6 to make a second nsIMutableArray
which contains the individual URI strings (rather than join()
ing them).
This would then use the array handling code for handling arguments which would avoid the .split("|")
that happens in the loadOneOrMoreURIs
call:
https://searchfox.org/mozilla-central/rev/3fd53c47864fedb916f0ed8f002f15456324f729/browser/base/content/browser.js#2356
https://searchfox.org/mozilla-central/rev/3fd53c47864fedb916f0ed8f002f15456324f729/browser/base/content/browser.js#2166
This should also have a new test that tests for opening a url (use something like https://example.com?foo=1|2|3
) and checking a window opens with just that URL and just one tab.
It could be based around some of the following ones:
https://searchfox.org/mozilla-central/source/browser/components/places/tests/browser/browser_library_open_bookmark.js
https://searchfox.org/mozilla-central/source/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js
For waiting for the new window, this function should be used
Comment 9•5 years ago
|
||
Hello, Can I try working on this bug?
Thanks :)
Aarushi
Comment 10•5 years ago
|
||
Sorry, I did not realize it was an error on windows machine.
And I am working on linux.
Sorry for the inconvinience
Comment 11•5 years ago
|
||
Hi Aarushi, there shouldn't be anything platform-dependent about this bug, so you should be able to work on it on Linux just fine. Let me know if you'd like to take it up.
Comment 12•5 years ago
|
||
Okay Mark
Shall take up this isse :)
Thanks
Aarushi
Comment 13•5 years ago
|
||
Great, I'll assign it to you, let me know if you have any questions or need help. You can also ask on Matrix in the Introduction channel.
Comment 14•4 years ago
|
||
Unfortunately I've not heard from Aarushi, so opening this up.
Comment 15•4 years ago
|
||
Hi Mark,
I'd like to be assigned this bug if possible. This would be my first opensource contribution, and I could certainly use the mentorship that you've offered. The code base was pretty intimidating at first, but I've been looking it over for a while now and I think I'm starting to get a decent handle on the issue. Thanks
Assignee | ||
Comment 16•4 years ago
|
||
Hi, since this is still unassigned I would like to pick it up. I have a draft for a fix I will submit shortly. Thanks
Assignee | ||
Comment 17•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 18•4 years ago
|
||
I'm having some trouble writing a test for this case.. Will put up patch including the test when it's done.
The test needs to do the following:
- Open bookmark library
- Close all open browser windows excluding library
- Create a bookmark in some folder with an URL containing '|' e.g. example.com?foo=1|2
- Right click folder to bring up context menu and click 'Open all in tabs'
- Check that only one tab is opened in a new window
So far I've only managed to get step 1 working, still looking through some other tests in browser/components/places/tests which hopefully has similar workflows to what I need here. Also can't get debugging to work on my test.. GDB won't stop at the breakpoints I set for some reason
Comment 19•4 years ago
|
||
(In reply to Andrew Park from comment #18)
- Close all open browser windows excluding library
You shouldn't need to do this, you can just expect a new window to open - see BrowserTestUtils.waitForNewWindow()
. https://searchfox.org/mozilla-central/search?q=symbol:%23waitForNewWindow&redirect=false
Or if you want an empty window you can just open a new one.
- Create a bookmark in some folder with an URL containing '|' e.g. example.com?foo=1|2
You could probably just do this with PlacesUtils.bookmarks.insert(...)
which is what a lot of the tests do. Then you only need to select it, e.g. https://searchfox.org/mozilla-central/source/browser/components/places/tests/browser/browser_library_open_bookmark.js
- Right click folder to bring up context menu and click 'Open all in tabs'
Similar functionality: https://searchfox.org/mozilla-central/rev/4fe8e4848664a182de3a0dbd781f93ae402012ab/browser/components/places/tests/browser/browser_library_bookmark_pages.js#31-46
- Check that only one tab is opened in a new window
If in the waitForNewWindow
you pass the url. Once that has loaded, you should be able to fairly easily check the number of tabs.
So far I've only managed to get step 1 working, still looking through some other tests in browser/components/places/tests which hopefully has similar workflows to what I need here. Also can't get debugging to work on my test.. GDB won't stop at the breakpoints I set for some reason
For javascript, you probably more want the Javascript debugger. You can kick that in with ./mach mochitest --jsdebugger path/to/test
- You'll want to include a debugger;
statement where you want it to pause the test.
Assignee | ||
Comment 20•4 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #19)
Thanks Mark for all the tips! With that I can really get started on writing the test. However in regards to this:
You shouldn't need to do this, you can just expect a new window to open - see
BrowserTestUtils.waitForNewWindow()
. https://searchfox.org/mozilla-central/search?q=symbol:%23waitForNewWindow&redirect=false
I think closing all windows is necessary. This bug is only reproducible if all windows are closed before you click "Open in all tabs." If there is an existing browser window already open (even an empty one) and you click "Open in all tabs," it will just open new tabs in the existing window instead of a new window, and it takes a different code path to load the URLs that doesn't have this problem.
Assignee | ||
Comment 21•4 years ago
|
||
So I have everything working except this step:
Close all open browser windows excluding library
I've noticed that if I do this the test just stops running. I'm thinking maybe that since this is equivalent to restarting Browser chrome tests can't handle this case? Maybe I'll look into Marionette instead.
If I just open the bookmarks in an existing window everything works but unfortunately that doesn't really test this particular case..
Comment 22•4 years ago
|
||
(In reply to Andrew Park from comment #21)
So I have everything working except this step:
Close all open browser windows excluding library
I've noticed that if I do this the test just stops running. I'm thinking maybe that since this is equivalent to restarting Browser chrome tests can't handle this case? Maybe I'll look into Marionette instead.
I think I've just found an alternative that runs the same code path - when right-click and clicking Open All in Tabs, on the click press shift. That forces opening in a new window, which reproduces the bug.
Here's some example code for that: https://searchfox.org/mozilla-central/rev/5a4aaccb28665807a6fd49cf48367d47fbb5a19a/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js#116-119
Assignee | ||
Comment 23•4 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #22)
I think I've just found an alternative that runs the same code path - when right-click and clicking Open All in Tabs, on the click press shift. That forces opening in a new window, which reproduces the bug.
Awesome, Mark. That was exactly what I needed thank you. I've put up a test using this method. Please have a look at the latest patch thanks!
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
bugherder |
Virtual_ManPL [:Virtual] 🇵🇱 - (please needinfo? me - so I will see your comment/reply/question/etc.)
Reporter
|
||
Comment 26•4 years ago
|
||
I'm confirming that bug is fixed, starting in Mozilla Firefox Nightly 80.0a1 (2020-07-04).
Thank you very much for fixing this very long standing bug! \o/
Updated•4 years ago
|
Description
•