Open Bug 1715410 Opened 3 years ago Updated 4 months ago

Session history forgets the title of pages with forms that POST to the same URL

Categories

(Firefox :: Session Restore, defect)

defect

Tracking

()

People

(Reporter: darktrojan, Unassigned)

Details

(Keywords: regressionwindow-wanted)

I have some extensions that use browser.sessions.getRecentlyClosed(). I've noticed that lately many (but not all) of the tabs returned have the URL in the title property instead of the title. If I open the library the pages in question have a real title.

Mostly it happens to bugzilla.mozilla.org pages, perhaps BMO does something weird to the history. I'm fairly sure I've seen it happen on other sites too, although I can't see that at the moment.

Could you share some reproduction steps? And even if you're not able to reproduce it, try to describe what you did in as much detail as possible.

Flags: needinfo?(geoff)

I haven't done anything in particular, just calling the function from the extension toolbox gets the same result.

There must be something weird about the tabs in question. It might be that the page has reloaded with the same URL, like it does when submitting a comment in Bugzilla. I'm going to try that now with this page.

Yeah, that seems to be a cause of the problem. So STR:

  • in a Bugzilla page, make a comment or other changes and save them
  • close the tab
  • call await browser.sessions.getRecentlyClosed() in the extension toolbox and see that the tab's title is its URL
Flags: needinfo?(geoff)

There have been some changes to Session History (for Fission) recently, is this a recent regression? Can you please run mozregression for this?

Flags: needinfo?(geoff)

Actually it's much older than I realised, and may have always been there. I went back as far as 81 before I gave up.

I've dug about as deep as I can, and somebody who knows this code better than me will be much faster at finding the cause. Here's what I've been working on:

  • Put a breakpoint here. (There's probably smarter ways to get here, but this worked for me.)
  • Load an html page with a title and a form that POSTs to itself.
  • Before submitting the form, history.legacySHistory.getEntryAtIndex(1).title is the title of the page.
  • Submit the form, and history.legacySHistory.getEntryAtIndex(1).title is now the URL of the page.
Component: General → Session Restore
Flags: needinfo?(geoff)
Product: WebExtensions → Firefox
Summary: sessions.getRecentlyClosed returning tabs without title → Session history forgets the title of pages with forms that POST to the same URL
QA Whiteboard: [qa-regression-triage]

Considering the fact that this is not even close to a recent regression (older than Fx81, according to comment 5) and that we can't reproduce it with the steps provided, I will remove it from our QA triage list.
I would be happy to attempt another investigation if more clear reproduction steps are provided. Please NI me if that's the case.

QA Whiteboard: [qa-regression-triage]
Has STR: --- → no
QA Whiteboard: QA-not-reproducible
QA Whiteboard: QA-not-reproducible → [qa-regression-triage], QA-not-reproducible

(In reply to Geoff Lankow (:darktrojan) from comment #3)

Yeah, that seems to be a cause of the problem. So STR:

  • in a Bugzilla page, make a comment or other changes and save them
  • close the tab
  • call await browser.sessions.getRecentlyClosed() in the extension toolbox and see that the tab's title is its URL

Hey Geoff, is this bug still an issue? If so, does it also manifest in the Recently Closed Tabs menu or just when using the extension API?

Flags: needinfo?(geoff)

I think it's now working properly in the UI but not in the API. IIRC it affected things like the back button context menu and history menu too, which I will check once I've submitted this comment.

The back button menu is still affected, but the history menu is not.

Flags: needinfo?(geoff)
You need to log in before you can comment on or make changes to this bug.