Steps to replicate the issue:
- Open Safari on iOS.
- Go, for example, to the testwiki;
- Add the following user script to your common.js:
mw.loader.load( 'https://test.wikipedia.org/w/index.php?title=User:Serhio_Magpie/testCors.js&action=raw&ctype=text/javascript' );
- or execute the following code in the browser console:
mw.loader.using( [ 'mediawiki.util', 'mediawiki.ForeignApi' ] ) .then( () => { const test = ( hostname ) => { const api = new mw.ForeignApi( 'https://' + hostname + mw.util.wikiScript( 'api' ) ); const params = { action: 'query', meta: 'siteinfo', siprop: 'general', format: 'json', formatversion: 2, }; api.get( params ) .done( response => { console.info( `======= ${ hostname } pass =======` ); console.log( response ); } ) .fail( error => { console.info( `======= ${ hostname } fails =======` ); throw new Error( error ); } ); }; test( 'meta.wikimedia.org' ); test( 'www.mediawiki.org' ); test( 'www.wikidata.org' ); } );
- See the errors in the browser console:
| Mobile site: | Desktop site: |
What happens?:
On the latest iOS 18.5 Safari, the first request made to the project using ForeignApi constantly fails regardless of desktop or mobile site version. All content blockers are disabled. On the latest Chrome or Firefox on Windows 11, all requests pass as they should.
| Mobile site: | Desktop site: |



