Este site está com funcionalidades limitadas enquanto realizamos manutenção para melhorar sua experiência de uso. Se nenhum artigo resolver seu problema e você quiser fazer uma pergunta, nossa comunidade de suporte pode te ajudar em @FirefoxSupport no Twitter e /r/firefox no Reddit.

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Saiba mais

Esta discussão foi arquivada. Faça uma nova pergunta se precisa de ajuda.

Is there a way to ignore Cross-Origin Request Blocked?

more options

Hi, I am learning web development. I am into AJAX now. When I try to use `load('ajax/somedata.txt')` in a local HTML file, I get the error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///home/sourav/The%20Complete%20Web%20Development%20Course/JQuery/ajax/somedata.txt. (Reason: CORS request not http).

Same happens with other browsers. But Falkon browser is an exception. The other way to fix this is running an http server (like WEBrick).

Just because Firefox is my favourite browser, I want to load up the file correctly in Firefox. Is there a way to do that without running a local HTTP server?

Hi, I am learning web development. I am into AJAX now. When I try to use `load('ajax/somedata.txt')` in a local HTML file, I get the error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///home/sourav/The%20Complete%20Web%20Development%20Course/JQuery/ajax/somedata.txt. (Reason: CORS request not http). Same happens with other browsers. But Falkon browser is an exception. The other way to fix this is running an http server (like WEBrick). Just because Firefox is my favourite browser, I want to load up the file correctly in Firefox. Is there a way to do that without running a local HTTP server?

Alterado por Sourav em

Todas as respostas (2)

more options

This link might have information for you.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp

There might not be a workaround.

more options

Rich B said

This link might have information for you. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp There might not be a workaround.

Actually, the article mentions the preference you can use to roll back the patch, but to use that, you may need to know the steps to change a preference.

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste uniq and pause while the list is filtered

(3) Double-click the privacy.file_unique_origin preference to switch the value from true to false

To mitigate the vulnerability this patch addressed:

Save pages from untrusted sites in a completely separate folder, e.g., Downloads\Untrusted. That would make it difficult for an attacker to find any valuable content using local file links.