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

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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.

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

Nirmos claimed this task.