Page MenuHomePhabricator

mobile.special.watchlist.scripts/watchlist.js contains overly generic selectors
Open, LowPublic

Description

$( '.more' ).remove();

could easily conflict with some other extension on the page

  1. Class names should be prefixed (mw-mf-)
  2. Global selectors should be avoided in JS. If the DOM node can't be kept in memory, selectors should at least be scoped to the application's root DOM node (e.g. $watchlist.find( '.mw-mf-more' ))

Event Timeline

Esanders created this task.Jan 9 2019, 1:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 9 2019, 1:07 PM
Jdlrobson triaged this task as Normal priority.Jan 9 2019, 4:32 PM
Jdlrobson added a project: Readers-Web-Backlog.
Jdlrobson moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

A similar issue on uploads.js

if ( $( '.errorbox' ).length === 0 ) {
Jdlrobson lowered the priority of this task from Normal to Low.Apr 9 2019, 4:29 PM