5 Ways To Fix “Not Allowed To Load Local Resource” Error (2024)

While inspecting a webpage in your browser’s Console, you might have come across the error message “Not Allowed to Load Local Resource.” This error message pops up when you try to load local resources in your browser, be it an image, scripts, or CSS file.

However, other web page elements may load normally, but a specific file will create the problem. For instance, you may face some of these error messages: net::ERR_CONNECTION_REFUSED, net::err_name_not_resolved, or the server responded with a status of 404.

Whatever the instances may be, we will guide you through the fixes that will help you sort out this error easily.

What Causes “Not Allowed to Load Local Resource” Error

Before moving to the fixes section, let’s point out some causes why you see the Not Allowed to Load Local Resource Error:

  • Files blocked by Chrome security
  • Disabled local file access
  • Problems with DNS server
  • Outdated Host cache

How to Fix Not Allowed to Load Local Resource Error

Fixing this error is not that tedious and time consuming. Making minor changes in your browser and terminal will help you resolve this error.

I have compiled a list of 5 fixes that you can apply when you face the error. Let’s dive straight into them:

Try Disabling the Chrome Security Settings

Since the error is caused due to the security feature of Chrome, the first thing you can do is disable the security settings. It is not recommended, but if it solves the issue, you can proceed with it.

Make sure the resource you are trying to load is not malicious. You should take care of it yourself. Else you will be vulnerable to attacks. Consider re-enabling the security after you are done loading the resources. Here’s how to do it:

  1. Click the menu button () in the top right corner of the Chrome window.
  2. Select Settings from the list of options.
  3. Click Privacy and Security from the left pane of the Settings page.
  4. Select the Security menu in the right section.
  5. Under Safe Browsing, click No protection (not recommended).
    5 Ways To Fix “Not Allowed To Load Local Resource” Error (1)
  6. In the next popup, click the Turn off button.
    5 Ways To Fix “Not Allowed To Load Local Resource” Error (2)

Change DNS Settings

Domain Name System (DNS) functions as a mediator between you and a web server for name resolution. It translates the domain names into IP addresses to load resources from the web server.

Your computer obtains a DNS address dynamically from your ISP. Sometimes, it may stop working, and your Internet connection may go down. You also face the titled error when there is an issue in the DNS server.

Moreover, if you are using a DNS address other than provided by your ISP, Chrome may block it, raising security concerns. You can use the Google DNS servers and see if it fixes the problem. Follow these steps:

  1. Right-click the Start button and select Run from the list of options.
  2. Type ncpa.cpl in the text field and hit Enter to open Network Connections.
  3. Right-click the active network adapter and click Properties.
  4. Select the Internet Protocol Version 4 (TCP/IPv4) option under the Networking tab.
  5. Click the Properties button.
    5 Ways To Fix “Not Allowed To Load Local Resource” Error (3)
  6. In the new Properties window, click Use the following DNS server addresses and enter the following IP address.
    • Preferred DNS server: 8.8.8.8
    • Alternate DNS server: 8.8.4.4
      5 Ways To Fix “Not Allowed To Load Local Resource” Error (4)
  7. Check Validate settings upon exit option and Click OK to save the changes.

Clear Host Cache

Chrome has a built-in DNS cache server to help improve the website loading speed. As we already discussed, DNS maps domain name to IP address; when the IP address for a website is changed, the cache may load the older IP address and cause the issue. It can even decrease the website loading speed.

In such a scenario, you must clear the host cache and see if the issue is solved. Here’s how to clear it:

  1. Copy and paste chrome://net-internals/#dns in the address bar of Chrome.
  2. Click the Clear host cache button.
    5 Ways To Fix “Not Allowed To Load Local Resource” Error (5)
  3. Exit from the browser and relaunch it to see if the issue persists.

Set Up an HTTP Server

If you face the Not Allowed to Load Local Resource error on Chrome, it is mostly due to security reasons. What you can do is set up an HTTP server on your computer and start to serve the files locally. While doing so, files will not be fetched from the network, and Chrome will stop blocking them. Here’s how you can do it:

  1. Launch your terminal.
  2. Type npm install -g HTTP-server and hit Enter.
  3. Go to the root folder and open it. In this case, the root folder is where you want to store your files. Type HTTP-server ./
  4. You will see something like http://localhost:8080 on the output screen of your terminal. You can retrieve everything stored here. For example, an image file named deepen.png can be retrieved using background: url('https://localhost:8080/deepen.png');

Install HTTP Server Extension For Chrome

You can also easily set up an HTTP server using the Chrome extension, namely Web Server for Chrome. It is the extension that runs offline and helps serve files and webpages to network from a local folder. It would fix issues if you had any while setting up an HTTP server manually. Follow these steps to install the extension:

  1. Go to the Web Server for Chrome extension page.
  2. Click the Add to Chrome button. You may be prompted to sign in to Chrome to add the extension.
  3. Once installed, open the extension.
  4. Click the CHOOSE FOLDER button and browse your project folder.
    5 Ways To Fix “Not Allowed To Load Local Resource” Error (6)
  5. Then click the address shown under Web server URL and run the web server.
    5 Ways To Fix “Not Allowed To Load Local Resource” Error (7)

Related Questions

What Are the Programs Affected By “Not allowed to load local resource”?

Chromium-based programs are mostly the victims of Not allowed to load local resource error. Because of having a strong security mechanism, they prevent you from loading files from local machines to protect you from any kind of malicious attacks.

They instead require you to load resources from a web server. Some Chromium programs are Google Chrome, Microsoft Edge, Opera, NodeJS, Atom, and Electron.

How Do I Enable Local Access in Chrome?

By default, If you have not given local access to Chrome, it cannot load the files from your local machine. In such a case, you may be facing the titled error with 404 status code. Follow these steps to enable local access:

  1. Close and Exit Chrome.
  2. Hit Windows + R key on your keyboard to open the Run dialog box.
  3. Type chrome.exe --allow-file-access-from-file in the text field and hit Enter.

What is the Difference Between 403, 404, and Not Allowed to Load Local Resource Error?

403 is a resource forbidden error. It occurs when you try to access the webpage or any resource you are not allowed to. You may not have enough permissions, and you might face an error.

You normally see the 404 error as Error 404 Page Not Found! It states that a webpage you want to view does not exist. It doesn’t mean the Server is down. It means the Server is reachable but cannot find the page you are looking for.

While, as discussed entirely in this post, Not Allowed to Load Local Resource error arises with the modern Chromium programs. Since they are equipped with high security of V8 engines, they don’t allow loading the local resources, and you may face the issue.

5 Ways To Fix “Not Allowed To Load Local Resource” Error (2024)

References

Top Articles
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 5922

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.