Closed Bug 1430019 Opened 3 years ago Closed 3 years ago

The user activation flag of document should keep its state after refreshing the tab

Categories

(Core :: DOM: Navigation, enhancement, P2)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: alwu, Unassigned)

References

Details

(Whiteboard: [block-ap-v1])

Attachments

(2 files)

|mUserHasActivatedInteraction| [1] should keep its state after refreshing the tab, so that the tab can still have autoplay permission.

[1] https://searchfox.org/mozilla-central/rev/88439dc6c5b02e167032374071cdc697a056efa1/dom/base/nsIDocument.h#3752
Priority: -- → P2
Whiteboard: block-ap-v1 → block-autoplay-v1
Whiteboard: block-autoplay-v1 → blockautoplay-v1
Whiteboard: blockautoplay-v1 → block-ap-v1
Samael, please help this one. Thank you.
Assignee: nobody → sawang
Whiteboard: block-ap-v1 → [block-ap-v1]
Hopefully, someone else will take on this.
Assignee: freesamael → nobody
bz: I'm looking at this bug, but I need some help understanding what the best approach is.

What we want to do here is propagate nsIDocument::mUserHasActivatedInteraction to the new document when refreshing or navigating a window if the new document is same-origin. I have this working by checking the old content viewer's document's state/origin in nsDocShell::SetupNewViewer(). Is there a better place to propagate this state when navigating?

I also want the flag to be preserved when pages are navigated via the forward/back button, i.e. we want to restore the mUserHasActivatedInteraction state that the document had when it was last viewed when we navigate forward/back to a document in session history. The above approach in nsDocShell::SetupNewViewer() doesn't work.

Do we need to save the value of that flag into the SHEntry and restore it in nsDocShell::Embed()? Does that sound like it would work, or is there a better way to propagate this state and store it in session history?

Thanks!
Flags: needinfo?(bzbarsky)
> Is there a better place to propagate this state when navigating?

Probably not.

> Do we need to save the value of that flag into the SHEntry and restore it in nsDocShell::Embed()?

Or in SetupNewViewer, yes....
Flags: needinfo?(bzbarsky)
We decided we didn't like the UX with this behaviour, so I'm closing this bug. I've uploaded my (very rough) WIP patches in case we want to come back to this sometime...
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.