Ajax using JavaScript by a chrome Extension - Error blocked cross-origin response with MIME type application/jsonCross-Origin Read Blocking (CORB)XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' headerHow to stop CORB from blocking requests to data resources that respond with CORS headers?Ajax call bug with Chrome new version 73.0.3683.75?Origin is not allowed by Access-Control-Allow-OriginHow does Access-Control-Allow-Origin header work?Response to preflight request doesn't pass access control checkCross-Origin Read Blocking (CORB)JavaScript Error : Cross-Origin Read Blocking (CORB) blocked cross-origin responseCross-Origin Read Blocking (CORB) issue in my Get Ajax requestGoogle maps api: Cross-Origin Read Blocking (CORB) blocked cross-origin responseUber Price API Getting error Cross-Origin Read Blocking (CORB) blockedCross-Origin Read Blocking Error in reactjsHow to avoid Cross-Origin Read Blocking(CORB) in a chrome web extension

Just graduated with a master’s degree, but I internalised nothing

How did Lefschetz do mathematics without hands?

How can a valley surrounded by mountains be fertile and rainy?

Why wasn't ASCII designed with a contiguous alphanumeric character order?

How could an armless race establish civilization?

What is "override advice"?

Word ending in "-ine" for rat-like

Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

Reusable spacecraft: why still have fairings detach, instead of open/close?

My colleague is constantly blaming me for his errors

What do you call a notepad used to keep a record?

Why did NASA wet the road in front of the Space Shuttle crawler?

Can a stressful Wish's Strength reduction be cured early by a Greater Restoration spell?

How do I tell the reader that my character is autistic in Fantasy?

Journal standards vs. personal standards

Is Cyclic Ether oxidised by periodic acid

How can I tell what kind of genitals people have without gender?

Closest Proximity of Oceans to Freshwater Springs

Can a nowhere continuous function have a connected graph?

Could human civilization live 150 years in a nuclear-powered aircraft carrier colony without resorting to mass killing/ cannibalism?

"Vector quantity" --More than two dimensions?

How can I deal with extreme temperatures in a hotel room?

Is there a legal way for US presidents to extend their terms beyond two terms of four years?

How to securely dispose of a smartphone?



Ajax using JavaScript by a chrome Extension - Error blocked cross-origin response with MIME type application/json


Cross-Origin Read Blocking (CORB)XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' headerHow to stop CORB from blocking requests to data resources that respond with CORS headers?Ajax call bug with Chrome new version 73.0.3683.75?Origin is not allowed by Access-Control-Allow-OriginHow does Access-Control-Allow-Origin header work?Response to preflight request doesn't pass access control checkCross-Origin Read Blocking (CORB)JavaScript Error : Cross-Origin Read Blocking (CORB) blocked cross-origin responseCross-Origin Read Blocking (CORB) issue in my Get Ajax requestGoogle maps api: Cross-Origin Read Blocking (CORB) blocked cross-origin responseUber Price API Getting error Cross-Origin Read Blocking (CORB) blockedCross-Origin Read Blocking Error in reactjsHow to avoid Cross-Origin Read Blocking(CORB) in a chrome web extension






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Failed to get a respond after Ajax a simple Array from JS by chrome extension to my back-end "python"



error appears in console :



Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:5000/test with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details



I've tried to check



https://www.chromestatus.com/feature/5629709824032768



and



https://www.chromium.org/Home/chromium-security/corb-for-developers



what i've learned from reading those two resources is why they have created CORB OR CORS but it doesn't suggest any example that would work for all dev or maybe i've got lost in the middle of it somehow , i'm not sure what i should do or add to my code



update:
i've also gave those a try



How to stop CORB from blocking requests to data resources that respond with CORS headers?



Cross-Origin Read Blocking (CORB)



XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' header



background.js



//added this part:

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse)
fetch(request.input, request.init).then(function(response)
return response.text().then(function(text)
sendResponse([
body: text,
status: response.status,
statusText: response.statusText,
, null]);
);
, function(error)
sendResponse([null, error]);
);
return true;
);


mainfest:




"manifest_version": 2,
"name": "testExtention",
"description": "test extention",

"browser_action" :
"default_title" : "hello computer!",
"default_popup" : "popup.html"
,

"background":
"scripts": ["background.js"]
,
"content_scripts": [

"matches": ["https://www.example.com/*", "https://m.example.com/*"],
"js": ["content.js"]
],

"version": "1.0",
"permissions": [ "tabs", "storage" ,"http://127.0.0.1:5000/*" ]





my js Ajax code:



const req = new XMLHttpRequest();
req.open('POST' , "http://127.0.0.1:5000/test");
// for cors
req.setRequestHeader("dataType",'json');
req.setRequestHeader('responseType','application/json');
req.setRequestHeader('Access-Control-Allow-Credentials' , 'true');
req.setRequestHeader('Access-Control-Allow-Origin','*');
req.setRequestHeader('Access-Control-Allow-Methods','GET');
req.setRequestHeader('Access-Control-Allow-Headers','application/json');

req.onload = ()=>

var res = JSON.parse(req.responseText);
console.log('the response from the server = > ',res)

const data = new FormData();
data.append('x', y);
req.send(data);



python:



from flask import Flask
from flask_cors import CORS ,cross_origin
app = Flask(__name__)

cors = CORS(app)


@app.route("/test" ,methods = ["POST"] )
def req():
y = request.form.get("x")
z = jsonify("success":y, 'headers':
'Access-Control-Allow-Credentials' : 'true',
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Methods':'GET',
'Access-Control-Allow-Headers':'application/json',
)
z = request.form.get("x")

print(f'ive recieved this nn z') // x is printed fine.

return jsonify("success":z)



i can see in the console that Python have received and printed the AJAX object but haven't send the response to the javaScript










share|improve this question
























  • Have you tried checking the solution in this SO post (Cross-Origin Read Blocking (CORB))? Also could you check this SO post(How to stop CORB from blocking requests to data resources that respond with CORS headers?) and this SO post(Ajax call bug with Chrome new version 73.0.3683.75?)?

    – MαπμQμαπkγVπ.0
    Mar 26 at 6:22











  • @MαπμQμαπkγVπ.0 i've updated my code and ticket , none of them have worked not sure why

    – J Rick
    Mar 26 at 14:24

















1















Failed to get a respond after Ajax a simple Array from JS by chrome extension to my back-end "python"



error appears in console :



Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:5000/test with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details



I've tried to check



https://www.chromestatus.com/feature/5629709824032768



and



https://www.chromium.org/Home/chromium-security/corb-for-developers



what i've learned from reading those two resources is why they have created CORB OR CORS but it doesn't suggest any example that would work for all dev or maybe i've got lost in the middle of it somehow , i'm not sure what i should do or add to my code



update:
i've also gave those a try



How to stop CORB from blocking requests to data resources that respond with CORS headers?



Cross-Origin Read Blocking (CORB)



XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' header



background.js



//added this part:

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse)
fetch(request.input, request.init).then(function(response)
return response.text().then(function(text)
sendResponse([
body: text,
status: response.status,
statusText: response.statusText,
, null]);
);
, function(error)
sendResponse([null, error]);
);
return true;
);


mainfest:




"manifest_version": 2,
"name": "testExtention",
"description": "test extention",

"browser_action" :
"default_title" : "hello computer!",
"default_popup" : "popup.html"
,

"background":
"scripts": ["background.js"]
,
"content_scripts": [

"matches": ["https://www.example.com/*", "https://m.example.com/*"],
"js": ["content.js"]
],

"version": "1.0",
"permissions": [ "tabs", "storage" ,"http://127.0.0.1:5000/*" ]





my js Ajax code:



const req = new XMLHttpRequest();
req.open('POST' , "http://127.0.0.1:5000/test");
// for cors
req.setRequestHeader("dataType",'json');
req.setRequestHeader('responseType','application/json');
req.setRequestHeader('Access-Control-Allow-Credentials' , 'true');
req.setRequestHeader('Access-Control-Allow-Origin','*');
req.setRequestHeader('Access-Control-Allow-Methods','GET');
req.setRequestHeader('Access-Control-Allow-Headers','application/json');

req.onload = ()=>

var res = JSON.parse(req.responseText);
console.log('the response from the server = > ',res)

const data = new FormData();
data.append('x', y);
req.send(data);



python:



from flask import Flask
from flask_cors import CORS ,cross_origin
app = Flask(__name__)

cors = CORS(app)


@app.route("/test" ,methods = ["POST"] )
def req():
y = request.form.get("x")
z = jsonify("success":y, 'headers':
'Access-Control-Allow-Credentials' : 'true',
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Methods':'GET',
'Access-Control-Allow-Headers':'application/json',
)
z = request.form.get("x")

print(f'ive recieved this nn z') // x is printed fine.

return jsonify("success":z)



i can see in the console that Python have received and printed the AJAX object but haven't send the response to the javaScript










share|improve this question
























  • Have you tried checking the solution in this SO post (Cross-Origin Read Blocking (CORB))? Also could you check this SO post(How to stop CORB from blocking requests to data resources that respond with CORS headers?) and this SO post(Ajax call bug with Chrome new version 73.0.3683.75?)?

    – MαπμQμαπkγVπ.0
    Mar 26 at 6:22











  • @MαπμQμαπkγVπ.0 i've updated my code and ticket , none of them have worked not sure why

    – J Rick
    Mar 26 at 14:24













1












1








1








Failed to get a respond after Ajax a simple Array from JS by chrome extension to my back-end "python"



error appears in console :



Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:5000/test with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details



I've tried to check



https://www.chromestatus.com/feature/5629709824032768



and



https://www.chromium.org/Home/chromium-security/corb-for-developers



what i've learned from reading those two resources is why they have created CORB OR CORS but it doesn't suggest any example that would work for all dev or maybe i've got lost in the middle of it somehow , i'm not sure what i should do or add to my code



update:
i've also gave those a try



How to stop CORB from blocking requests to data resources that respond with CORS headers?



Cross-Origin Read Blocking (CORB)



XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' header



background.js



//added this part:

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse)
fetch(request.input, request.init).then(function(response)
return response.text().then(function(text)
sendResponse([
body: text,
status: response.status,
statusText: response.statusText,
, null]);
);
, function(error)
sendResponse([null, error]);
);
return true;
);


mainfest:




"manifest_version": 2,
"name": "testExtention",
"description": "test extention",

"browser_action" :
"default_title" : "hello computer!",
"default_popup" : "popup.html"
,

"background":
"scripts": ["background.js"]
,
"content_scripts": [

"matches": ["https://www.example.com/*", "https://m.example.com/*"],
"js": ["content.js"]
],

"version": "1.0",
"permissions": [ "tabs", "storage" ,"http://127.0.0.1:5000/*" ]





my js Ajax code:



const req = new XMLHttpRequest();
req.open('POST' , "http://127.0.0.1:5000/test");
// for cors
req.setRequestHeader("dataType",'json');
req.setRequestHeader('responseType','application/json');
req.setRequestHeader('Access-Control-Allow-Credentials' , 'true');
req.setRequestHeader('Access-Control-Allow-Origin','*');
req.setRequestHeader('Access-Control-Allow-Methods','GET');
req.setRequestHeader('Access-Control-Allow-Headers','application/json');

req.onload = ()=>

var res = JSON.parse(req.responseText);
console.log('the response from the server = > ',res)

const data = new FormData();
data.append('x', y);
req.send(data);



python:



from flask import Flask
from flask_cors import CORS ,cross_origin
app = Flask(__name__)

cors = CORS(app)


@app.route("/test" ,methods = ["POST"] )
def req():
y = request.form.get("x")
z = jsonify("success":y, 'headers':
'Access-Control-Allow-Credentials' : 'true',
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Methods':'GET',
'Access-Control-Allow-Headers':'application/json',
)
z = request.form.get("x")

print(f'ive recieved this nn z') // x is printed fine.

return jsonify("success":z)



i can see in the console that Python have received and printed the AJAX object but haven't send the response to the javaScript










share|improve this question
















Failed to get a respond after Ajax a simple Array from JS by chrome extension to my back-end "python"



error appears in console :



Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:5000/test with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details



I've tried to check



https://www.chromestatus.com/feature/5629709824032768



and



https://www.chromium.org/Home/chromium-security/corb-for-developers



what i've learned from reading those two resources is why they have created CORB OR CORS but it doesn't suggest any example that would work for all dev or maybe i've got lost in the middle of it somehow , i'm not sure what i should do or add to my code



update:
i've also gave those a try



How to stop CORB from blocking requests to data resources that respond with CORS headers?



Cross-Origin Read Blocking (CORB)



XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' header



background.js



//added this part:

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse)
fetch(request.input, request.init).then(function(response)
return response.text().then(function(text)
sendResponse([
body: text,
status: response.status,
statusText: response.statusText,
, null]);
);
, function(error)
sendResponse([null, error]);
);
return true;
);


mainfest:




"manifest_version": 2,
"name": "testExtention",
"description": "test extention",

"browser_action" :
"default_title" : "hello computer!",
"default_popup" : "popup.html"
,

"background":
"scripts": ["background.js"]
,
"content_scripts": [

"matches": ["https://www.example.com/*", "https://m.example.com/*"],
"js": ["content.js"]
],

"version": "1.0",
"permissions": [ "tabs", "storage" ,"http://127.0.0.1:5000/*" ]





my js Ajax code:



const req = new XMLHttpRequest();
req.open('POST' , "http://127.0.0.1:5000/test");
// for cors
req.setRequestHeader("dataType",'json');
req.setRequestHeader('responseType','application/json');
req.setRequestHeader('Access-Control-Allow-Credentials' , 'true');
req.setRequestHeader('Access-Control-Allow-Origin','*');
req.setRequestHeader('Access-Control-Allow-Methods','GET');
req.setRequestHeader('Access-Control-Allow-Headers','application/json');

req.onload = ()=>

var res = JSON.parse(req.responseText);
console.log('the response from the server = > ',res)

const data = new FormData();
data.append('x', y);
req.send(data);



python:



from flask import Flask
from flask_cors import CORS ,cross_origin
app = Flask(__name__)

cors = CORS(app)


@app.route("/test" ,methods = ["POST"] )
def req():
y = request.form.get("x")
z = jsonify("success":y, 'headers':
'Access-Control-Allow-Credentials' : 'true',
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Methods':'GET',
'Access-Control-Allow-Headers':'application/json',
)
z = request.form.get("x")

print(f'ive recieved this nn z') // x is printed fine.

return jsonify("success":z)



i can see in the console that Python have received and printed the AJAX object but haven't send the response to the javaScript







javascript python ajax google-chrome google-chrome-extension






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 14:21







J Rick

















asked Mar 25 at 14:13









J RickJ Rick

14414 bronze badges




14414 bronze badges












  • Have you tried checking the solution in this SO post (Cross-Origin Read Blocking (CORB))? Also could you check this SO post(How to stop CORB from blocking requests to data resources that respond with CORS headers?) and this SO post(Ajax call bug with Chrome new version 73.0.3683.75?)?

    – MαπμQμαπkγVπ.0
    Mar 26 at 6:22











  • @MαπμQμαπkγVπ.0 i've updated my code and ticket , none of them have worked not sure why

    – J Rick
    Mar 26 at 14:24

















  • Have you tried checking the solution in this SO post (Cross-Origin Read Blocking (CORB))? Also could you check this SO post(How to stop CORB from blocking requests to data resources that respond with CORS headers?) and this SO post(Ajax call bug with Chrome new version 73.0.3683.75?)?

    – MαπμQμαπkγVπ.0
    Mar 26 at 6:22











  • @MαπμQμαπkγVπ.0 i've updated my code and ticket , none of them have worked not sure why

    – J Rick
    Mar 26 at 14:24
















Have you tried checking the solution in this SO post (Cross-Origin Read Blocking (CORB))? Also could you check this SO post(How to stop CORB from blocking requests to data resources that respond with CORS headers?) and this SO post(Ajax call bug with Chrome new version 73.0.3683.75?)?

– MαπμQμαπkγVπ.0
Mar 26 at 6:22





Have you tried checking the solution in this SO post (Cross-Origin Read Blocking (CORB))? Also could you check this SO post(How to stop CORB from blocking requests to data resources that respond with CORS headers?) and this SO post(Ajax call bug with Chrome new version 73.0.3683.75?)?

– MαπμQμαπkγVπ.0
Mar 26 at 6:22













@MαπμQμαπkγVπ.0 i've updated my code and ticket , none of them have worked not sure why

– J Rick
Mar 26 at 14:24





@MαπμQμαπkγVπ.0 i've updated my code and ticket , none of them have worked not sure why

– J Rick
Mar 26 at 14:24












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55339816%2fajax-using-javascript-by-a-chrome-extension-error-blocked-cross-origin-respons%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55339816%2fajax-using-javascript-by-a-chrome-extension-error-blocked-cross-origin-respons%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현