Chrome open local html file

Using google-chrome Version 81.0.4044.138 [Official Build] [64-bit] on a MacbookAir Mojave I want to open a html file that is located on the filesystem and linked from another page i.e woth something like

bla

but when clicking on that link I only see the following text in the address bar

 about:blank#blocked

Is there any way to enable this/ allow this, so that I can open that page with one click?

So far I have to:

  • Right click on that link
  • Copy the link address
  • Open a new tab
  • Paste the link

to open the page. Can this be made ANY way simpler?

P.S. These local html files are generated by myself and do link themselves only to pages that are trusted. I do not see any security risks.

asked May 12, 2020 at 7:04

1

We do not use file protocol to open other html, css, js or image files.

"file://" requires absolute path and instruct browsers to download a file. many browsers will block the file.

just use Summary. Use relative path from index.html file location.

answered May 19, 2020 at 19:34

Puneet ChandhokPuneet Chandhok

3731 gold badge3 silver badges13 bronze badges

This has been disabled on purpose - security. You can directly open file via file:/// directive, but not via links.

The only way I found out is to install a plugin called Enable local file links. If you want to check source code to be sure you can do that at its github page.

It will enable you opening a local file when clicking on a shortcut.

answered May 14, 2020 at 9:59

tukantukan

15.8k1 gold badge19 silver badges46 bronze badges

8

Google Chrome Help

Sign in

Google Help

  • Help Center
  • Community
  • Google Chrome
  • Privacy Policy
  • Terms of Service
  • Submit feedback

Send feedback on...

This help content & information

General Help Center experience

  • Help Center
  • Community

Google Chrome

I am trying to open a local HTML file but I get an error every time that I do. The error message is as follow:

Error: Windows cannot access the specified device, path, or file. You may not have the appropriate permission to access the item

I have checked the properties of the file and I do have access to everything about it and I have tried other HTML files too. These files open perfectly on Microsoft edge and internet explorer, but not with Chrome. I have updated, repaired and reinstalled google chrome but to no avail. I remember a while back I was tinkering with RegEdit so that may be the issue? I am not 100% sure though as I was not editing Google Chrome files.

Thanks.

  1. 1

    Understand HTML. HTML stands for Hypertext Markup Language. HTML files are text files which represent the content and the layout of a web page. To read an HTML file, you can use any text editor [e.g notepad, notepad++, or any specialized HTML editor]. However, if you want to see what the program looks like, you need to run it on a web browser, which is designed to read and render HTML files.

  2. 2

    Write or copy HTML into a basic text editor. As you become a more proficient coder, you can use HTML editing programs like Adobe Dreamweaver, Microsoft Expression Web, CoffeeCup, and Visual Studio Code, but a simple program is all you need to start. Notepad [Windows] or TextEdit [Mac] should suffice.

    Advertisement

  3. 3

    Save the file as your-file.html. If you make an HTML file in Notepad, TextEdit, or any other text editor, be sure to save it with the proper notation. Before saving the file, make sure that you have changed your "Save as type" to "All files" [if needed] and click "Save".

  4. Advertisement

  1. 1

    Make sure that there is a browser installed on your computer. To run a HTML file on your computer you must have a browser.

  2. 2

    Find the saved file. If you think the file is in a certain folder, but you cannot find it, try running a file search on your computer. Type your-file.html into the search box at the bottom of the Start menu [if using Windows] or the search box in the Finder app [if using a Mac].

    • HTML files usually are in a folder with the same name as the .html file but without the .html extension. Inside of the folder may be different files such as .js .css , images and other files. Do not worry about those, they are necessary files for the layout and functionality of the page. It is necessary not to delete these files. Leave them in the same directory [folder] as your html file, otherwise the page won't display properly. If you would like to modify an html file, you will need to learn coding in html and other scripting languages

  3. 3

    Right-click [Windows] or double-click [Mac] the file and select "Open with" from the action menu. You will be able to choose between any of the browsers that are installed on your computer, although your computer's default browser will top the list. Open the file using any web browser: Google Chrome, Mozilla Firefox, Safari, etc.

    • Most computers will associate your default browser with the .html file extension. That means that normally, you don't need to find a browser to open the file—you can just double-click on it, and the computer will open it in your default web browser.
    • If your computer doesn't recognize the file, Windows will ask whether to open this file using an already installed application, or search for the extension on the internet. Select the "open using already installed applications" option. You will be able to choose from a list of all browsers installed on the system.

  4. 4

    View your HTML file in your chosen browser. The browser automatically interprets your coding and displays it. The location of the file will be displayed in the address bar—this will help you confirm that the HTML file has been opened, and not any other.

  5. 5

    Alternate method: Run your browser, then press Ctrl-O. This should pull up an "Open" menu. Find your file, double-click it, and watch your program open up in a browser tab. Different browsers may have different "Open" hotkeys, so check your browser settings.

  6. Advertisement

  1. 1

    Open your preferred FTP platform. If your host has one built in, stick with that—it will make it a lot simpler. If not, use a third-party FTP host like FileZilla.

  2. 2

    Next, connect to your remote server [your website's server]. If you're using the built-in platform, you don't need to worry about this. You'll see two boxes on the left and two boxes on the right. Don't worry about the left or top right ones; all you need to focus on is the bottom right box.

  3. 3

    Locate your HTML file and drag it into the box. It will start the upload right away. If you're using the built-in platform, find and locate the "htdocs" [or default HTML] folder and press "Upload"; it will give you options from there.

    • Don't use the shortcut! This will upload the LNK Mirror file, which you don't want.

  4. 4

    Wait until the file is uploaded. Then, if you've removed the default page, go and view your website to see your HTML file! If you see a directory listing, click the .html file to view.

  5. Advertisement

Add New Question

  • Question

    How do I run the HTML code from the notepad?

    Save the file as an HTML file type. Then, open the file and it should open in a browser.

  • Question

    How do I open the file in Notepad again after opening it in the browser?

    Do the opposite of what you did to make it an html file. Save it as index.txt from index.html.

  • Question

    How do I run an HTML program using Chrome?

    First, save the program on your desktop with an extension ".html," then right click on the file document and click on open with Chrome.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • For better performance, use a better web browser than Internet Explorer 7.

Thanks for submitting a tip for review!

Advertisement

About This Article

Thanks to all authors for creating a page that has been read 518,811 times.

Is this article up to date?

How do I open an HTML file locally?

HTML: Viewing HTML-files.
start your browser..
under the "File" menu click on "Open Page" ... .
in this new box, click on "Choose File" [if you cannot fill-in the file's location directly].
once the file is found [in the "File Browser" window], click "OK".

Why is my HTML code not opening in Chrome?

Check if the file is saved with a UTF-8 encoding. If that doesn't work, try installing another browser or using Edge/Safari/Internet Explorer or whatever built-in browser you have. It is saved as index.

How do I open an HTML file on a PC?

Most computers will associate your default browser with the . html file extension. That means that normally, you don't need to find a browser to open the file—you can just double-click on it, and the computer will open it in your default web browser.

How do I open a local HTML file in Chrome for Android?

You have to grant Chrome permission to access the Android File System. Then opening a html page including javascript, css and images should work..
On your Android, open Settings ..
Tap Apps & notifications..
At the bottom, tap Advanced..
Tap Default apps..
Tap Browser App Chrome..

Chủ Đề