Closed Bug 1904556 Opened 5 months ago Closed 5 months ago

Pull-to-refresh is activated once on Youtube shorts

Categories

(Web Compatibility :: Interventions, defect)

Firefox 129
All
Android
defect

Tracking

(firefox127 wontfix, firefox128 fixed, firefox129 verified)

RESOLVED FIXED
Tracking Status
firefox127 --- wontfix
firefox128 --- fixed
firefox129 --- verified

People

(Reporter: ljanos, Assigned: twisniewski)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Steps to reproduce

  1. Using a clean profile, open https://m.youtube.com/shorts.
  2. Activate Pull-to-refresh

Expected behavior

Pull-to-refresh is not activated based on https://bugzilla.mozilla.org/show_bug.cgi?id=1882040.

Actual behavior

Pull-to-refresh is activated at first, but after that cannot be activated anymore.

Device information

  • Firefox version: Firefox Nightly 129.0a1
  • Android device model: Samsung Galaxy S23 Ultra
  • Android OS version: Android 14.

Any additional information?

  • Also reproducible on the latest Beta 128.0b7 and latest RC 127.0.2.
  • Also reproduced on an LG Nexus 5 (Android 6.0.1) and on a Samsung Tab S8 Ultra (Android 12).
  • If the page is scrolled down before that only pull-to-refresh action, the videos above that screen are lost.
Severity: -- → S3
Summary: Pull-to-refresh is activated on Youtube shorts → Pull-to-refresh is activated once on Youtube shorts
See Also: → 1882040

After the first pull to refresh what's needed to to reset the count again? If you go to a different page and come back again is pull-to-refresh enabled/disabled? If you kill the browser and restart what's the state then?

Flags: needinfo?(ljanos)

There is at least one reason I can see for this. If you happened to be browsing YouTube Shorts when you closed Firefox, the session-restored version of the page when you restart Firefox will not apply any CSS WebCompat site interventions. I recall this being due to a limitation of the web extension APIs, which the WebCompat interventions rely on (as it's a built-in web extension).

But this is not supposed to be the case if you load YouTube Shorts in a fresh tab. It doesn't look like our WebCompat intervention is being loaded at all if I open a fresh tab and visit YouTube Shorts, until the tab is reloaded. This is completely unexpected. I'll have to investigate what's going on here.

This is very odd. I just made a local build of Fenix from moz-central, and ran it on the emulator.. and everything is working fine (pull to refresh is disabled as expected). And I can't seem to get a build working on my actual phone, it just crashes no matter what I do, so I'm going to ask Ksenia on my team to help out here, and see if a local build works on her phone as well.

Ksenia cannot build the APK, and my arm64 build also crashes for her, so we're kind of stuck here. I have no idea why on an actual phone, the nightly build is behaving this way, while a local build in an emulator works as I would expect it to.

Ahh. After some digging around, it turns out that this is actually caused by a silly oversight on my part. See this match-pattern in the intervention to disable pull-to-refresh on YouTube Shorts?

 matches: ["*://m.youtube.com/shorts/*"],

Well, it doesn't match the base URL https://m.youtube.com/shorts. So the first time you visit that base URL, it won't match, and pull-to-refresh will work. But when you actually pull-to-refresh, the URL changes to the full video's URL, and it matches the above, so pull-to-refresh is disabled. I should have used this instead:

 matches: ["*://m.youtube.com/shorts", "*://m.youtube.com/shorts/*"],

With that, things seem to work as expected as the base URL as well.

I'm not sure if this is worth fixing at this point, unless we're having another dot release without bug 1902313.

Flags: needinfo?(ljanos)
Assignee: nobody → twisniewski
Status: NEW → ASSIGNED
Attachment #9409569 - Flags: approval-mozilla-beta?
Attachment #9409570 - Flags: approval-mozilla-release?
Pushed by twisniewski@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1e0211b65b39 fix the CSS intervention to disable pull-to-refresh on the YouTube Shorts mobile page; r=webcompat-reviewers,denschub
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch

beta Uplift Approval Request

  • User impact if declined: Pull-to-refresh will interfere with scrolling on YouTube Shorts on Firefox on Android
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Visit m.youtube.com/shorts on Android, verify that pull to refresh is disabled
  • Risk associated with taking this patch: Low
  • Explanation of risk level: This only disables pull-to-refresh on YouTube Shorts in the way Google recommends to disable it String changes made/needed No
  • String changes made/needed: No
  • Is Android affected?: yes
Flags: qe-verify+
Attachment #9409569 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Depends on: 1882040
See Also: 1882040

Verified as fixed on the latest Nightly build (129.0a1 from 2024-06-28) using a Samsung Galaxy S23 Ultra (Android 14).
The pull-to-refresh action is not triggered on Youtube shorts.
One note here: while this ticket isn't about the possibility of enable/disable the fix from about:compat/interventions/Youtube shorts, I noticed that it stays fixed, meaning that the pull-to-refresh function is off no matter the setting from about:compat/interventions/Youtube shorts.
Marking the ticket as verified for 129.

Flags: qe-verify+

Comment on attachment 9409570 [details]
Bug 1904556 - fix the CSS intervention to disable pull-to-refresh on the YouTube Shorts mobile page;

Rejecting release uplift request. Fx128 merges to release on Monday 2024-07-01.
We don't have any Fx127 dot release planned before then.

Attachment #9409570 - Flags: approval-mozilla-release? → approval-mozilla-release-
Blocks: 1882722
Component: Media → Interventions
Product: Fenix → Web Compatibility
Target Milestone: 129 Branch → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: