Page MenuHomePhorge

Investigate Metrolook ad placement
Open, HighPublic

Assigned To
Authored By
Jun 15 2016, 11:19 AM
Referenced Files
F168: c4b90d60-32fe-11e6-9131-b496df463bf2.png
Jun 15 2016, 9:08 PM
F170: c706607c-32fe-11e6-8706-d0927eb98e52.png
Jun 15 2016, 9:08 PM
F155: pasted_file
Jun 15 2016, 8:25 PM
F138: image.png
Jun 15 2016, 11:19 AM


image.png (768×1 px, 367 KB)

Ad placement on Metrolook seems to be problematic for some users - that being said in my Chrome it works fine. This should be checked out to see if there is an underlying issue.

Event Timeline

This looks like it could've been a temporary glitch due to whatever JavaScript loading issues or somesuch on Google's end, or missing JS dependencies; more details, especially on reproducibility, would help. There's a possibility that this bug is one that manifests only on certain platforms (Windows, maybe just Windows 7) when using a certain version of Google Chrome.

From the screenshot I can see that it's Google Chrome on Windows 7 at 1366x768px. I tested this out on Chromium 50.0.2661.102 under Ubuntu 16.04 (64-bit) at 1280x800px (as well as in the developer tools' "responsive design" mode to emulate mobile environments where the screen resolution is smaller). The wide skyscraper ad is only shown for screens which are at least 1300 pixels wide (as per /extensions/ShoutWikiAds/css/metrolook-wide-skyscraper-ad.less). The related div#content rule in that file might be related, though I'm not so sure; in my tests, the leaderboard ad was never misplaced the way it is in this screenshot.

Ads are looking weird on Mobile Chrome too. Samsung Galaxy A3, Android 5.0.2, Mobile Chrome 51. Can anyone check ads with other browsers?

pasted_file (738×1 px, 87 KB)

Sidebar isn't working, after a couple of refreshes here and there - Using Windows 10, Chrome v51.0.2704.84, 1366 x 768

Oddly enough, I've gotten several different ad placements, including the correct one. This is on Chrome 51.0.2704.84 on OS X 10.11.4 (El Capitan). Here are some examples:

c706607c-32fe-11e6-8706-d0927eb98e52.png (2×2 px, 162 KB)

c4b90d60-32fe-11e6-9131-b496df463bf2.png (1×2 px, 147 KB)

So something somewhere is calling document.write, which isn't really supported in MediaWiki anymore and that's breaking things. This results in a warning logged into the browser's JS console: "Use of 'write' is deprecated. Use jQuery or mw.loader.load instead.". This traces back to the file /resources/src/mediawiki.legacy/wikibits.js.
I was able to reproduce the broken ad behavior in Opera 37.0.2178.32 under Windows 7.

Now the next step is to figure out what might be calling document.write and replace that with something better. A potential culprit is the DismissableSiteNotice extension, although I don't know why that'd be breaking only one skin instead of most/all skins. (There's an upstream ticket for that on Wikimedia's Phabricator, FWIW.)