HomePhabricator

Update code that hides site notice from search engines

Authored by Krinkle on Apr 19 2017, 7:55 PM.

Description

Update code that hides site notice from search engines

While it might work for Bing, document.write() does not seem to be
enough to hide text from Google, as evident from a Google Search results
page that listed various pages from frr.wikipedia.org when searching
for the text of an active site notice

Additionally, core commit d861c6593a55 has broken document.write() logic
as the mediawiki.legacy.wikibits module now replaces it with its own code,
which can cause the site notice to end up at the bottom of the page (just
after #content, the last child of the body element at the time the script is
executed) instead of in its proper place (inside #siteNotice).

Instead of document.write(), use a temporary placeholder element and replace
it with parsed HTML directly using proper DOM methods.

Bug: T108811
Bug: T125323
Change-Id: I8052f01519f22558630489f97fc0ce126bf76dac

Details

Committed
KrinkleApr 19 2017, 7:57 PM
Parents
rEDSN2539f3f2367e: Add stylelint for css files
Branches
Unknown
Tags
Unknown
References
REL1_29, refs/changes/58/261758/4
ChangeId
I8052f01519f22558630489f97fc0ce126bf76dac