Advertisement
Technical_13

Promise { <state>: "pending" }

Feb 6th, 2018
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     async function getUserSkinJSContent() {
  2.       var content = await ( new mw.Api() ).get( {
  3.         action: 'query',
  4.         titles: 'User:' + mw.config.get( 'wgUserName' ) + '/' + mw.user.options.get( 'skin' ) + '.js',
  5.         prop: 'revisions',
  6.         rvprop: 'content',
  7.         indexpageids: true
  8.       } ).done( function( data ) {
  9.         var qry = data.query;
  10.         return qry.pages[ qry.pageids[ 0 ] ].revisions[ 0 ][ "*" ];
  11.       } );
  12.       return content;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement