webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
739 stars 63 forks source link

gyao.yahoo.co.jp - Incorrect redirect when trying to play a video #69512

Open webcompat-bot opened 3 years ago

webcompat-bot commented 3 years ago

URL: https://gyao.yahoo.co.jp/title/PRODUCE%20101%20JAPAN%20SEASON2/6011ee14-1e12-47ec-833c-819a43f93ab9

Browser / Version: Firefox Mobile 88.0 Operating System: Android 11 Tested Another Browser: Yes Chrome

Problem type: Something else Description: Google Play Steps to Reproduce: Step to Reproduce Tap "▶再生する" (in English, play video) Expected Redirect to the page of its video player app on Google Play Actual Redirect to its toppage

Browser Configuration
  • gfx.webrender.all: false
  • gfx.webrender.blob-images: true
  • gfx.webrender.enabled: false
  • image.mem.shared: true
  • buildID: 20210330185720
  • channel: beta
  • hasTouchScreen: true
  • mixed active content blocked: false
  • mixed passive content blocked: false
  • tracking content blocked: false

View console log messages

From webcompat.com with ❤️

softvision-oana-arbuzov commented 3 years ago

Thanks for the report, I was able to reproduce the issue. IncorrectRedirect

Note: The issue is not reproducible on Chrome where I'm redirected to Google Play. image

Tested with: Browser / Version: Firefox Nightly 210404 (🦎 89.0a1-20210403093157) Operating System: Google Pixel 5 (Android 11) - 1080 x 2340 pixels, 19.5:9 ratio (~432 ppi density)

Moving to Needsdiagnosis for further investigation.

ksy36 commented 3 years ago

This is based on UA detection.

When I spoof as Chrome and click on the button a GET request is sent to https://approach.yahoo.jp/ host and it returns a 302 redirect to the play store with intent://

Screen Shot 2021-06-25 at 6 25 35 PM

I case of Firefox, it just returns a html page in response. The following code is executed to perform redirect:

// fallback to redirect if could not open app or back to from app
            var redirect = function() {
                var loaded = location.hash.substr(1)|0;
                var now = Date.now()/1000|0;
                if (now - loaded > 5) {
                    location.replace(leaveRedirecorUrl);
                    if (timer) { clearInterval(timer); }
                }
            };

            // set hash and execute approach
            if (!location.hash) { location.hash = (Date.now()/1000|0); }
            timer = setInterval(redirect, 1000);

The site should adjust UA detection rule for Firefox, to make it receive intent similar to Chrome. Lets try to contact them

webcompat-bot commented 3 years ago

Generate outreach template