Page MenuHomePhabricator

VisualEditor fails to load on first-run, throwing JS SecurityError due to ? reading from localStorage in maybeShowWelcomeDialog
Closed, ResolvedPublic1 Story Points

Description

On https://meta.wikimedia.org/w/index.php?title=User:FrussiWM&veaction=edit as unregistered user (before the page was created), the VE seems to load but when the loading bar is full it stops and I can't proceed to the editor

This page is using the deprecated ResourceLoader module "jquery.ui.widget".  load.php:18:86
This page is using the deprecated ResourceLoader module "jquery.ui.core".
Please use "mediawiki.ui.button" or "oojs-ui" instead.  load.php:11:84
This page is using the deprecated ResourceLoader module "jquery.ui.position".  load.php:40:291
SecurityError: The operation is insecure.  load.php:301
	ve.init.mw.ArticleTarget.prototype.maybeShowWelcomeDialog https://meta.wikimedia.org/w/load.php:301:683
	ve.init.mw.DesktopArticleTarget.prototype.surfaceReady https://meta.wikimedia.org/w/load.php:1107:102
	bound  self-hosted

Details

Related Gerrit Patches:
mediawiki/extensions/VisualEditor : masterWrap localStorage.getItem calls in try { ... } catch () {}

Event Timeline

Nemo_bis created this task.Dec 15 2016, 8:47 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 15 2016, 8:47 AM
Jdforrester-WMF triaged this task as Medium priority.Dec 15 2016, 6:39 PM
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

From the error, like the browser JS-fatals on localstorage reads? Odd.

Jdforrester-WMF renamed this task from VisualEditor fails to load to VisualEditor fails to load on first-run, throwing JS SecurityError due to ? reading from localStorage in maybeShowWelcomeDialog.Dec 15 2016, 6:39 PM

It looks like the behaviour that Chrome & FF exhibit when you disable cookies/localStorage will break this code (though I'm not sure what exactly causes "The operation is insecure" here), so let's assume that's the problem.

Change 327663 had a related patch set uploaded (by Alex Monk):
Wrap localStorage.getItem calls in try { ... } catch () {}

https://gerrit.wikimedia.org/r/327663

Jdforrester-WMF closed this task as Resolved.Dec 16 2016, 5:11 AM
Jdforrester-WMF removed a project: Patch-For-Review.

Change 327663 merged by jenkins-bot:
Wrap localStorage.getItem calls in try { ... } catch () {}

https://gerrit.wikimedia.org/r/327663