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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 7 2019, 8:33 PM
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?

DannyS712 updated the task description. (Show Details)Sep 7 2019, 8:45 PM

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.

Masumrezarock100 added a comment.EditedSep 7 2019, 9:10 PM

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 moved this task from Unsorted to Others on the User-DannyS712 board.Sep 7 2019, 9:19 PM

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

Force_Radical added a comment.EditedSep 8 2019, 5:55 PM

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...

nray moved this task from Needs triage to Triaged on the Mobile board.Sep 10 2019, 12:26 AM