Page MenuHomePhabricator

The `#jump-to-nav` div will be removed in Vector - gadgets will be impacted without change
Open, Needs TriagePublic

Description

Up to 320 user scripts [1] reference the jump-to-nav element to insert UI elements. This element will be removed within the next few weeks and those scripts may break or misbehave without any changes.

Without change this is likely to impact the display of UI elements in code such as:

 $node.insertAfter('#jump-to-nav');
document.getElementById('jump-to-nav').nextSibling

We recommend using the #siteSub or #mw-content-text elements as potential replacements.

Potentially impacted scripts

[1] https://global-search.toolforge.org/?q=jump-to-nav&regex=1&namespaces=&title=.*js

Event Timeline

Restricted Application added subscribers: Strainu, jeblad, Danmichaelo and 3 others. · View Herald TranscriptOct 13 2020, 4:08 PM
Jdlrobson updated the task description. (Show Details)Oct 13 2020, 4:08 PM
Jdlrobson updated the task description. (Show Details)
nray added a subscriber: nray.Oct 13 2020, 4:11 PM
JJMC89 updated the task description. (Show Details)Oct 13 2020, 4:16 PM

Hi @Jdlrobson If I understand correctly, the wording in the user-notice should be something like:

Some gadgets and user-scripts use the HTML div #jump-to-nav. This div will be removed soon. Maintainers should replace these uses with either #siteSub or #mw-content-text. A list of affected scripts is at the top of phab:T265373.

If that is inaccurate/imperfect, then Please provide a correct version.
I will add it to TechNews tomorrow (Friday) morning (PST) before this issue is frozen for translation, for delivery on Monday.

TheDJ added a subscriber: TheDJ.Oct 21 2020, 8:49 AM

I remember that [[#jump-to-nav]] in the past was also used as an anchor link sometimes instead of [[#top]]. Might be another impact to look out for.

Do the alternate divs exist in other skins, or will scripts that aim to work across multiple skins need to make an existence check? If the latter, can you provide an example code snippet to aid maintainers?

This element was never part of a standard skin spec so the HTML may or may not be in other skins. Right now this has only been removed in Vector. Other skins should not be impacted.

I'd recommend always doing an existence check for any gadget as other gadgets can alter the look and feel of the skin.

Does that answer your question?

Jony added a subscriber: Jony.Oct 23 2020, 4:51 PM