Page MenuHomePhabricator

Add support for mobile websites global js and global css
Closed, DuplicatePublicFeature

Description

Request: Load user's global.js and global.css when using mobile too

Problem statement:
Currently JavaScript codes in one's global.js and global.css user subpage only loads in desktop interface. Global CSS and JavaScript subpages acts almost like common.js/common.css, but it doesn't load on mobile websites. Without this ability, GlobalCssJs doesn't accomplish its core goal of eliminating the need to manually import scripts on each site

Example use case:
https://meta.wikimedia.org/wiki/User:DannyS712/Global_watchlist.js creates a global watchlist at Special:BlankPage.js, and is generally imported into user's global.js; it should also be available when using the mobile interface

Event Timeline

DannyS712 changed the subtype of this task from "Task" to "Feature Request".
DannyS712 added a subscriber: Pathoschild.

Until this is implement, perhaps @Pathoschild knows a work around with Synchbot?

Also, for now, typing mw.loader.load('//meta.wikimedia.org/w/index.php?title=User: {username} /global.js&action=raw&ctype=text/javascript'); into your javascript console accomplishes this

The current workaround is to import scripts from global-mobile.css/js on Meta into each local minerva.css/js page using Synchbot. When global CSS/JS becomes available on mobile, you'll need another Synchbot run to remove the manual imports.

The current workaround is to import scripts from global-mobile.css/js on Meta into each local minerva.css/js page using Synchbot. When global CSS/JS becomes available on mobile, you'll need another Synchbot run to remove the manual imports.

I never knew about this bot. I've added an edit request.

@DannyS712 Would it be possible for you to create a patch to fix this issue?

I think having a global-minerva.js for the time being would be a better option. Most of the scripts currently in use don't detect the mobile interfaces and are not optimized for it. Enabling global.js on mobile without any prior intimation may lead to a whole lot of things breaking...