Page MenuHomePhabricator

Provide a way to "sticky" enable ResourceLoader's debug mode
Open, LowPublic

Description

  • If debug=true, remember in session
  • the "set debugmode" code should check session in addition to GET query param
  • going to debug=false will also unset it in the session

Allows to navigate the wiki, submit forms (T37061), and stuff.

To prevent users from unknowingly staying in debug mode, JS should but up an informational notification on the page informing something short like: "You've enabled debug mode of client resources delivery, click here to disable this"

Details

Reference
bz35063

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:19 AM
bzimport set Reference to bz35063.
bzimport added a subscriber: Unknown Object (MLST).

Since setting a cookie "resourceLoaderDebug" enables debug mode, this probably can be done easily on client side.

(In reply to comment #1)

Since setting a cookie "resourceLoaderDebug" enables debug mode, this probably
can be done easily on client side.

The cookie can be set on the client side, however the initial server request needs to know this before any client code is processed because it influences how the page is rendered very early on. (one could implement a redirect/refresh, but that gives the same problem with form submissions).

This needs (at least some) server development. But that's OK, it's not a hard thing to do :), just other priorities right now (although patches are welcome at any time :)

(In reply to comment #1)

Since setting a cookie "resourceLoaderDebug" enables debug mode, this probably
can be done easily on client side.

Ah, this is already implemented. I didn't know that. (bug 25610 slipped by silently, and it never made it into documentation).

Repurposing this bug for the GUI module.

Krinkle renamed this task from Implement a front-end for interacting with resourceLoaderDebug cookie to Implement front-end for toggling the "resourceLoaderDebug" cookie.Nov 25 2014, 7:04 PM
Krinkle updated the task description. (Show Details)
Krinkle removed a project: Future-Release.
Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
Krinkle renamed this task from Implement front-end for toggling the "resourceLoaderDebug" cookie to Provide a way to "sticky" enable ResourceLoader's debug mode.Apr 2 2019, 3:04 AM

Deprioritising until after T85805: Introduce ResourceLoader debug mode v2.

Right now debug mode changes execution behaviour in a significant way, and can be very slow for modules with 1000s of class files (such MediaViewer, Wikibase and VisualEditor). I expect T85805 will make debug mode more performant and less intrusive.

After that, I think it would be worth considering to allow developers, WMF staff and other interested tech-savvy users to browse our sites with "debug mode" enabled by default. Whether through a beta feature, regular preference, via WikimediaDebug extension, or some other way.

I propose to resolve this by documenting a one-line snippet that sets the cookie-based debug mode flag for a period of time (e.g. 1 hour).