I'm working on a browser extensions that calls the WikiData SPARQL API and it works with my Manifest V2 Firefox extension, but the same call in my Manifest V3 Chrome extension "failed to fetch" with the status as "(blocked:other)" and no other details. I narrowed down the issue to a single part of the URL:
?WikipediaEN schema:isPartOf <https://en.wikipedia.org/> .
Changing the Wikipedia URL part to just a set of empty quotes makes the fetch work (but of course does not return the needed result from the API) so it seems it's related to either the Wikipedia URL or maybe the angled brackets? I've read elsewhere that ad blockers can something block requests that contain certain keywords, but I made sure any ad blocker was not enabled on my Chrome and the fetch still doesn't work.
Why is Chrome blocking the fetch because of this in the URL? Are there restrictions in the WebExtension API with the fetch that would block because of this line in particular? What I can do to make this call work? Again, it works fine for my MV2 Firefox add-on. (edit: the same request works in Firefox MV3 as well, not just FF MV2)
Nothing is wrong with the Javascript or manifest permissions, as it works for other domains as well as the same WikiData with a different query and removing the single line mentioned above will also make the fetch work.
Full URL sent for the WikiData SPARQL API:
https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json&query=SELECT DISTINCT ?item ?itemLabel ?BirthName ?Date_Of_Birth ?Date_Of_Birth_Precision ?Date_Of_Death ?Date_Of_Death_Precision ?BirthCityLabel ?BirthCountry ?DeathCityLabel ?DeathCountry ?Wikipedia ?WikipediaEN ?Years_Start ?Years_End WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
{
SELECT DISTINCT ?item WHERE {
?item p:P4985 ?statement0.
?statement0 ps:P4985 "500".
}
LIMIT 10
}
OPTIONAL {
?item wdt:P1477 ?BirthName.
FILTER(LANG(?BirthName) = "en") .
}
OPTIONAL {
?item p:P569 ?BirthEntry.
?BirthEntry ps:P569 ?Date_Of_Birth.
?BirthEntry psv:P569 [wikibase:timePrecision ?Date_Of_Birth_Precision].
?BirthEntry a wikibase:BestRank
}
OPTIONAL {
?item p:P570 ?DeathEntry.
?DeathEntry ps:P570 ?Date_Of_Death.
?DeathEntry psv:P570 [wikibase:timePrecision ?Date_Of_Death_Precision].
?DeathEntry a wikibase:BestRank
}
OPTIONAL { ?item wdt:P2031 ?Years_Start. }
OPTIONAL { ?item wdt:P2032 ?Years_End. }
OPTIONAL {
VALUES ?locationType {wd:Q532 wd:Q515 wd:Q3957 wd:Q1549591 wd:Q179872 wd:Q7830213}
?item p:P19 ?Entry.
?Entry ps:P19 ?BirthCity.
?BirthCity wdt:P31/wdt:P279* ?locationType.
OPTIONAL {
?BirthCity p:P17 ?Country.
?Country ps:P17 ?Country_Of_Birth.
?Country a wikibase:BestRank
OPTIONAL {
?Country_Of_Birth wdt:P298 ?BirthCountry.
}
}
}
OPTIONAL {
VALUES ?locationType2 {wd:Q532 wd:Q515 wd:Q3957 wd:Q1549591 wd:Q179872 wd:Q7830213}
?item p:P19 ?Entry.
?Entry ps:P19 ?BirthTemp.
?BirthTemp wdt:P131 ?BirthCity.
?BirthCity wdt:P31/wdt:P279* ?locationType2.
OPTIONAL {
?BirthCity p:P17 ?Country.
?Country ps:P17 ?Country_Of_Birth.
?Country a wikibase:BestRank
OPTIONAL {
?Country_Of_Birth wdt:P298 ?BirthCountry.
}
}
}
OPTIONAL {
VALUES ?locationType3 {wd:Q532 wd:Q515 wd:Q3957 wd:Q1549591 wd:Q179872 wd:Q7830213}
?item p:P20 ?Entry2.
?Entry2 ps:P20 ?DeathCity.
?DeathCity wdt:P31/wdt:P279* ?locationType3.
OPTIONAL {
?DeathCity p:P17 ?Country2.
?Country2 ps:P17 ?Country_Of_Death.
?Country2 a wikibase:BestRank
OPTIONAL {
?Country_Of_Death wdt:P298 ?DeathCountry.
}
}
}
OPTIONAL {
VALUES ?locationType4 {wd:Q532 wd:Q515 wd:Q3957 wd:Q1549591 wd:Q179872 wd:Q7830213}
?item p:P20 ?Entry2.
?Entry2 ps:P20 ?DeathTemp.
?DeathTemp wdt:P131 ?DeathCity.
?DeathCity wdt:P31/wdt:P279* ?locationType4.
OPTIONAL {
?DeathCity p:P17 ?Country2.
?Country2 ps:P17 ?Country_Of_Death.
?Country2 a wikibase:BestRank
OPTIONAL {
?Country_Of_Death wdt:P298 ?DeathCountry.
}
}
}
OPTIONAL {
?WikipediaEN schema:about ?item .
?WikipediaEN schema:inLanguage "en" .
?WikipediaEN schema:isPartOf <https://en.wikipedia.org/> .
}
}