Hello, thanks for your work here https://www.mediawiki.org/wiki/Topic:Vqy1kx6q4e0bzvyb .

I had already tryed to use this code on this: https://www.veikkos-archiv.com/index.php?title=MediaWiki:Mobile.js But till now there is no effect on this site. Do you know why?

(I tried a lot to find the reason - maybe by activating / deact the different MediaWiki extension.) Kyebert (talk) 15:36, 16 December 2024 (UTC)Reply

@Kyebert Your Mobile.js code looks fine — first thing I'd check is whether any Javascript you add there is actually working? If not, either something is preventing it or needs to be enabled. You might just try adding putting the console.log line at the start to see if that does anything.
You might also look into this, per Extension:MobileFrontEnd:
In order for the stylesheet to function you may have to add mw.loader.using('mobile.site.styles') to your MediaWiki:Mobile.js.
Could anything from your LocalSettings.php be preventing the Javascript from loading? I also haven't tested this on newer versions of MediaWiki or Minerva, so it's possible something may have broken.
Below are my relevant LocalSettings.php settings in case anything here is helpful. I believe I customized the AdvacedMainMenu and PersonalMenu but I can't recall why:
# MobileFrontEnd Settings (updated 07.19.20)
wfLoadExtension( 'MobileFrontend' );
$wgMFAutodetectMobileView = true;
wfLoadSkin( 'MinervaNeue' );
$wgMinervaDonateLink = [ 'base' => false, ];
$wgMinervaAdvancedMainMenu = [
   'beta' => false,
   'base' => true,
   'amc' => true,
 ];
$wgMinervaPersonalMenu = [
   'beta' => false,
   'base' => true,
   'amc' => true,
 ];

Knomanii (talk) 02:57, 19 December 2024 (UTC)Reply

Hello,
thank you for your time.
Some hints/questions:
  1. any Javascript: I can't remeber, that I use any other additional JS code as https://www.veikkos-archiv.com/index.php?title=MediaWiki:Mobile.js
  2. Extension:MobileFrontEnd: This feature was removed completely in version 1.39. LocalSettings.php settings: I have the same settings.
  3. How / where can I add mw.loader.using('mobile.site.styles') in the MediaWiki:Mobile.js ?
  4. What exactly do you mean with console.log Normaly I use // Debug $wgDevelopmentWarnings = true; $wgShowExceptionDetails = true; $wgShowExceptionDetails = true; $wgShowDBErrorBacktrace = true; $wgShowSQLErrors = true; -> but here in this case without success
Sorry - so many hints/questions. Maybe you have some infos for me to the single points? Kyebert (talk) 10:41, 19 December 2024 (UTC)Reply
@Kyebert To test if Mobile.js is loading properly, add this to the first line of MediaWiki:Mobile.js:
alert("Javascript is working!");
Once you save that, do a hard reload (Ctl+Shift+R on Chrome) to clear your cache and load the new javascript. If the javascript on Mobile.js is loading, you should get a pop-up alert that says "Javscript is working!" If not, it means your MediaWiki:Mobile.js page isn't loading anything for some reason.
You could try adding mw.loader.using('mobile.site.styles') as your first line of code and testing again to see if that helps anything.
However, per these threads, it sounds like more recent versions of MobileFrontEnd stopped using MediaWiki:Mobile.js and instead use MediaWiki:Minerva.js. So, if the above doesn't work, try copying & pasting your code to MediaWiki:Minerva.js instead. Sounds like that should work. Knomanii (talk) 11:50, 19 December 2024 (UTC)Reply
Bingo!
I found a solution here: Topic:Yb4dz9jg9a4deodo
Not MediaWiki:Mobile.js , but MediaWiki:Minerva.js Kyebert (talk) 16:30, 19 December 2024 (UTC)Reply