Page MenuHomePhabricator

Previewing user JavaScript runs without script validation checks
Closed, ResolvedPublic

Description

If you add something like

let test = 'hello';
console.log( test );

to Special:MyPage/common.js you'll get

JavaScript parse error: Parse error: Missing ; before statement in file '<file>' on line 1

This is expected per T75714 and not what this bug is about. However, if you preview your /common.js with this code, it actually does work. This suggests that previewed JavaScript does not go through ResourceLoader's minifier.

Event Timeline

Nirmos created this task.Apr 18 2018, 7:12 AM
Restricted Application added a project: Performance-Team. · View Herald TranscriptApr 18 2018, 7:12 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle added a subscriber: Krinkle.EditedApr 18 2018, 7:07 PM

It not being minified is intentional. However, it is not intentional that it bypasses validation. These are separate steps. I'll rephrase the task accordingly.

Krinkle renamed this task from Previewed JavaScript does not go through ResourceLoader's minifier to Previewing user JavaScript runs without script validation checks.Apr 18 2018, 7:08 PM
Krinkle triaged this task as Low priority.
Krinkle moved this task from Inbox to Confirmed Problem on the MediaWiki-ResourceLoader board.
Krinkle edited projects, added Performance-Team (Radar); removed Performance-Team.
Krinkle moved this task from Limbo to Watching on the Performance-Team (Radar) board.
Nirmos added a comment.May 8 2020, 5:44 PM

Has this bug somehow been fixed since I filed it? I can't reproduce it anymore.

Nirmos closed this task as Resolved.May 27 2020, 12:41 PM
Nirmos claimed this task.