Page MenuHomePhabricator

Can't add statements on mobile due to Cross-Origin Request Blocked
Closed, DuplicatePublic

Description

For whatever reason when I start typing no examples from Wikidata are shown, meanwhile if I do this using the desktop mode I do get it.

On desktop it looks like this making it quite easy to add them.

Event Timeline

DonTrung created this task.Apr 24 2019, 1:25 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 24 2019, 1:25 AM

@DonTrung: Please always include specific steps to reproduce (URL) and please always include exact browser information and browser version information when reporting any issues. Assuming this is about Multimedia due to captions. A project tag is required to be added to this task so someone can find this task.

Thanks. I can reproduce and the Developer Tools in Firefox show:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.wikidata.org/w/api.php?action=query&format=json&origin=https%3A%2F%2Fcommons%2Em%2Ewikimedia%2Eorg&meta=userinfo%7Ctokens. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
load.php:2701:4: mw.Api error:  http Object { xhr: {…}, textStatus: "error", exception: "" }

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&origin=https%3A%2F%2Fcommons%2Em%2Ewikimedia%2Eorg&centralauthtoken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&search=Sun%20Yat-Sen&language=en&uselang=en&type=item. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
load.php:2701:4 mw.Api error:  http Object { xhr: {…}, textStatus: "error", exception: "" }

ext.centralauth.ForeignApi.js:209:5 TypeError: abortable.abort is not a function
    abort ext.centralauth.ForeignApi.js:209
    abortRequest RequestManager.js:90
    abortLookupRequest LookupElement.js:289
    closeLookupMenu LookupElement.js:208
    onLookupInputBlur LookupElement.js:106
    <anonymous> (index):975
    jQuery 2
Aklapper renamed this task from Can't add file captions on mobile to Can't add file captions on mobile due to Cross-Origin Request Blocked.Apr 24 2019, 1:27 PM
matthiasmullie renamed this task from Can't add file captions on mobile due to Cross-Origin Request Blocked to Can't add statements on mobile due to Cross-Origin Request Blocked.Apr 24 2019, 3:26 PM

Change 506151 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[operations/mediawiki-config@master] Allow cross-site requests from mobile domains

https://gerrit.wikimedia.org/r/506151

Change 506151 merged by jenkins-bot:
[operations/mediawiki-config@master] Allow cross-site requests from mobile domains

https://gerrit.wikimedia.org/r/506151