📜 ⬆️ ⬇️

Yandex is killing a business, or be careful with the #main block

UPD 03/16/2016: The new version of the add-on no longer kills !

The title, of course, is absolutely yellow. I want to tell a short detective story about how big and powerful Yandex decided to destroy a business ( not specifically, of course - quite by accident, by mistake ) to our small and cozy website, and why creating browsers extensions that should only work on certain sites - it is important to prescribe in the code that the extension works only on these specific sites, and not on any more.

The bottom line is that a couple of months ago, we began to receive requests from users, complaining that they could not place an ad on the site, because the footer runs over the "add" button, with screenshots, such as these:
')


It would seem that the layout just went, the footer began to run down to the content, what's with Yandex?

The brave layout makers immediately rushed to investigate the problem, but it was impossible to repeat the error - in all browsers, even the oldest and strangest versions, the layout was correctly displayed, the footer did not run into the add button, and in general, beauty and idyll.



Users who wrote about the problem, eventually logged in via IE or FF and successfully added their ads - but those who were interested in this. And a certain number of users who did not want to bother with those. support and other browsers, we obviously lost - while we could not figure out the reason.

That was until until, finally, one of the technically savvy complainants did not give us a full list of the extensions installed on Chrome:
Music sig vkontakte 3.1.15, Alternative search 8.17.0, Visual bookmarks 2.26.2, Search and homepage - Yandex 8.15.0,


After we installed these extensions and logged into the site, the problem was confirmed - the footer really began to run into content!

To make the problem clearer, I will explain that on the site we used the classic method of gluing the basement to the bottom of the page when three blocks are created.

<body> <div id="wrap"> <div id="main"></div> </div> <div id="wrap-footer"></div> </body> 


 * { margin: 0; } html, body { height: 100%; } #wrap { min-height: 100%; margin: 0 auto -155px; } #main { padding: 0 0 155px 0; } #wrap-footer { height: 155px; } 


And this code worked perfectly smoothly until Yandex created a wonderful extension. Alternate search 8.17.0 .



The idea of ​​expanding is absolutely good:
Fast switching between search services - Yandex, Google, Mail.ru, Bing, YouTube or search on VKontakte videos.

In one click, you can get an answer to your question from Yandex, Google, Mail.ru, Bing, YouTube or search on VKontakte videos. The extension is available on all listed sites.


In fact, this extension really, as stated, on all listed sites (Yandex, Google, Mail.ru, Bing, YouTube) adds a panel for quickly switching between search engines.

But for all other (not listed) sites, it for some reason removes padding-bottom from the block with id main .
That is just when loading the page does
 <div id="main" style="padding-bottom:0;"></div> 


Thus, Yandex, with its extension, simply blocked the addition of ads on our site to all users who have it installed. Not very nice of them.

At the time of publication, the extension was installed on 97,424 Google Chrome users and, I suspect that it is distributed with some other applications, or is proposed to be installed on Yandex sites, because our users, they said, did not install this extension themselves, and do not use it.

UPDATE (thanks to BarakAdama ): the extension is advertised on Yandex when switching the search engine:



If there is a #main block on your website too, check if this extension is breaking your layout too.

The bug report has been sent, the layout on the site has been changed - instead of padding, a block-pusher of the appropriate height has been added to the bottom of the page.

Happy end.

Source: https://habr.com/ru/post/279257/


All Articles