web-bugs icon indicating copy to clipboard operation
web-bugs copied to clipboard

m.commonhealth.com.tw - layout is messed up

Open MDTsai opened this issue 10 years ago • 9 comments

URL: http://m.commonhealth.com.tw/ Browser / Version: Firefox 48.0 Operating System: Android 5.1.1 Problem type: Layout is messed up

Steps to Reproduce

  1. Navigate to: http://m.commonhealth.com.tw/
  2. First time connect will show a pop-up full page ad, but in Firefox for Android 48, this ad is not aligned in screen center. So user can't close this ad. But second time user will not see this ad.

Expected Behavior: Ad in screen center

Actual Behavior: Ad in screen top-left

Can't reproduce in Firefox for Android 49 and above.

Screenshot Description

From webcompat.com with ❤️

MDTsai avatar Aug 12 '16 08:08 MDTsai

Screenshot of Firefox for android 49

file:///home/eric/%E5%9C%96%E7%89%87/Screenshot_2016-08-12-15-45-23.png

MDTsai avatar Aug 12 '16 08:08 MDTsai

Screenshot of the site issue

MDTsai avatar Aug 12 '16 08:08 MDTsai

I do not get the pop up ad at all even with a clean profile. :/

Can you reproduce @MDTsai

karlcow avatar Aug 12 '16 10:08 karlcow

@karlcow, yes I can. I need to clear privacy data, otherwise second time it wouldn't show the pop-up ad.

I found if I use firefox 48, the ad css is:

<div id="dclk_overlay_490099717" style="position: absolute; visibility: visible; z-index: 2147483640; top: -175px; left: -130px;">

If I use firefox 50, the ad css is:

<div id="dclk_overlay_84519912" style="position:absolute;top:145px;left:50px;width:260;height:400;visibility:visible;z-index:2147483640;">

MDTsai avatar Aug 15 '16 02:08 MDTsai

I never get a pop up ads even with a fresh profile on Firefox 48 and Firefox 50

karlcow avatar Aug 15 '16 06:08 karlcow

Let's push to needsdiagnosis and wait for @MDTsai analysis.

karlcow avatar Aug 16 '16 01:08 karlcow

Here is my finding: The ad is embedded in http://m.commonhealth.com.tw, line 559:

In dfpPop.jsp, line 30, the script will pull content to iframe:

It will conduct a request to https://securepubads.g.doubleclick.net/gampad/, the result contains a JSON object with ad content.

In ad content, the ad in center of screen is:

As I found top and left value are negative value, so they are caused by topPosition and leftPosition.

For leftPosition, it comes from: var creativeWidth = "260"; var dcw=window.innerWidth; leftPosition=(dcw-creativeWidth)/2 + "px";

For topPosition, it comes from: var creativeHeight = "400"; var dch=window.innerHeight; topPosition=(dch-creativeHeight)/2 + 25 +"px";

Guess when the ad content inserted to dfpPop.jsp, window.innerWith and innerHeight are negative value, so left and top are incorrect.

I don't know how to insert break point to javascript write externally so I can't make sure my assumption is correct or not.

MDTsai avatar Aug 16 '16 09:08 MDTsai

I don't know how to insert break point to javascript write externally so I can't make sure my assumption is correct or not.

Yeah this is tricky @MDTsai. One thing I've done using http://www.charlesproxy.com/ (they have a 1 month trial version, worth requesting a license for though -- email me if you need help getting approval for that...) is the following:

https://www.charlesproxy.com/documentation/tools/map-local/

That way you can "map local" a specific JS asset to one that sits on your desktop. I usually beautify the script (if it was minified) and if breakpoints won't work, putting in a debugger statement does the trick.

miketaylr avatar Aug 18 '16 18:08 miketaylr

Close as Firefox mobile 49 released and this is not reproducable on Firefox mobile 49.

MDTsai avatar Sep 21 '16 08:09 MDTsai