Closed Bug 1643871 Opened 5 years ago Closed 5 years ago

LinkedIn defeats Firefox autoplay blocker

Categories

(Core :: Audio/Video: Playback, defect)

77 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: plroskin, Unassigned)

Details

Attachments

(4 files)

Attached image video-playing.png

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

Reading my LinkedIn feed using mouse scroll button.

Actual results:

A video started playing while the mouse cursor was over that video.

Expected results:

The video should not have started playing. I have a global "Block Audio and Video" setting for Autoplay without any exceptions.

Not all videos play automatically, but many do. I'm attaching a screenshot of a video that started playing.

It is not even required for the mouse cursor to be over the video. The mouse cursor just has to be on the same horizontal line as the video.

Attached image settings.png

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Please check our public documentation for blocking autoplay [1] to see how does blocking autoplay works. I believe that the issue you mentioned is because you've activated the page by user gesture before so that we won't block autoplay since then.

Feel free to set NI on me if you still have questions to blocking autoplay.

Thank you.

[1] https://docs.google.com/document/d/1p81bYntlLMTxXoANnQXS9KH0TZ4y8aKKeH9x3GVS3eY/edit#heading=h.k3q4co83ntet

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME

I didn't have media.autoplay.blocking_policy in about:config. I added it as an integer value and tried setting it to 1 and 2. It didn't change the behavior of Firefox. Is that part of the document obsolete?

media.autoplay.default is set to 5 (bold, i.e. non-default), media.autoplay.enabled.user-gestures-needed is true (default). I didn't try to change them.

Here's a clean experiment. I added a link to https://www.linkedin.com/in/farnazghadaki/detail/recent-activity/ to Bookmarks Menu. I open that page in a new tab. The video is not playing initally. I use the mouse to pull the scrollbar down and up. The video starts playing as soon as it appears on the screen again.

Let's consider the gesture definition from the document:

"This policy would block autoplay for the page which hasn’t been activated by user gestures, which includes keyboard pressing (printable keys, carriage return key and space key), mouse clicking, touch (includes both touch and pointer event)."

I don't touch the keyboard. The mouse clicking is on the browser scrollbar, not on the page itself. I don't have a touchscreen, so there is no touch. So I believe there was no gesture.

It would be great if Firefox tried to accommodate my specific preference (no autoplay) rather than expand the definition of gesture to ignore my preference.

Flags: needinfo?(alwu)

Ah, sorry, the document is for the latest version, and the old pref is media.autoplay.enabled.user-gestures-needed.

Setting media.autoplay.enabled.user-gestures-needed=true is equal to media.autoplay.blocking_policy=0, and setting media.autoplay.enabled.user-gestures-needed=false is equal to media.autoplay.blocking_policy=2. media.autoplay.blocking_policy=1 is the new policy we added recently.

So the default behavior for you is sticky user gesture activation, I would suggest you to use media.autoplay.enabled.user-gestures-needed=false to see if it works for you. (and the old pref would be automatically migrated to the new pref once you update the firefox)

Flags: needinfo?(alwu)

I tried media.autoplay.enabled.user-gestures-needed=false, it blocks autoplay for LinkedIn videos. I also downloaded the current Firefox Nightly and tried media.autoplay.blocking_policy=1. It doesn't block autoplay. Videos start playing as soon as I start scrolling the page with the mouse.

So the problem is that using a scrollbar is incorrectly treated as a "gesture" that unblocks autoplay.

Please note that having a document about the internals of the blocking doesn't make this issue invalid or unimportant. There is still a disconnect between what I set in the preferences (block any autoplay) and what I observe on LinkedIn (videos played automatically while scrolling through the feed).

Flags: needinfo?(alwu)

I'm 100% sure that scolling won't be regarded as a supported user gesture. So the only possibility is that you've clicked (either keyboard or mouse) on the Linked page before media starts playing, which results in not able to block those media, or you've added LinkedIn to the allow list for blocking autoplay.

Flags: needinfo?(alwu)

There is another possibility, namely that this bug is valid and Firefox is not behaving as it should.

I have already posted a screenshot of the autoplay settings. There is no exception for LinkedIn or for any other site.

I still can reproduce the issue. I'm very careful not to interact with the window in question in any non-described way.

  • I use the right mouse button to invoke the pop-up menu on https://www.linkedin.com/in/farnazghadaki/detail/recent-activity/
  • I select "Open Link in New Window".
  • A new window opens.
  • I drag the scroll bar slider down using the mouse.
  • At some point, I reach the bottom, the new contents loads.
  • Once again, I drag the scroll bar slider down using the mouse until I see a video (it's currently "AI Economist").
  • The video starts playing on its own.

Alastor, if you cannot reproduce the issue, could you please ask someone else to check?

"Read the fine print" was bad enough to reply to a user who wants control that Firefox promises and fails to deliver. But calling user's account in question is even worse, it's called gaslighting. Most users would have given up at this point.

Flags: needinfo?(alwu)

Could you help me use MOZ_LOG=Autoplay:5 [1] when trying the step that you mentioned in comment8, and upload it on the bugzilla?
In addition, just want to confirm these things with you again. The pref media.autoplay.default is setting to 5 and you didn't add linkedIn to the allow-list, right?
Thank you.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging

Flags: needinfo?(alwu) → needinfo?(plroskin)

Now I got what the problem is, I'll fix it in bug1649358, sorry for the inconvenience.

Flags: needinfo?(plroskin)

Hmm, sorry, I was wrong. If you don't mind, I still need a debug log so that I can know what happened. Thank you.

Flags: needinfo?(plroskin)
Attached file firefox.log.moz_log

I ran

MOZ_LOG=Autoplay:5 MOZ_LOG_FILE=$HOME/firefox.log firefox

I found following files after closing Firefox:

firefox.log.child-1.moz_log
firefox.log.child-2.moz_log
firefox.log.child-3.moz_log
firefox.log.moz_log

firefox.log.child-2.moz_log and firefox.log.child-3.moz_log were empty, I'm uploading the other two.

I confirm that media.autoplay.default is set to 5 and that linkedin.com is not in the allow-list.

I'm running Firefox 78.0.1+build1-0ubuntu0.18.04.1 now, which it the current Ubuntu package. I still see the autoplay. I only use the scrollbar to scroll the page with the mouse. I opened the page from bookmarks to avoid any use of the keyboard once the page is loaded. The only keyboard key I used is Alt to show the bookmark menu.

Flags: needinfo?(plroskin) → needinfo?(alwu)
Attachment #9163055 - Attachment mime type: application/octet-stream → text/plain
Flags: needinfo?(alwu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: