• Apple Watch
  • Accessories
  • Digital Magazine – Subscribe
  • Digital Magazine – Info
  • Smart Answers
  • Let Loose iPad event
  • New iPad Air
  • iPad mini 7
  • Best Mac antivirus
  • Best Mac VPN

When you purchase through links in our articles, we may earn a small commission. This doesn't affect our editorial independence .

Can’t open HTML pages in Safari? Add Safari to Full Disk Access

Safari app icon

Viewing downloaded HTML pages or previewing pages from a text editor or Web site design app in a browser can be a routine activity for many of us. But what do you do when you get this unexpected error?

Safari can’t open the page. The error is “The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 1.)” (kCFErrorDomainCFNetwork:1)

It seems like a deep and elaborate problem. Fortunately, the answer is straightforward: macOS is telling you that you haven’t given Safari permission to open files from local volumes. This is part of Apple’s general security profile in macOS that prevents apps from opening files in locations or of a type for which they haven’t been explicitly granted permission.

There’s no real risk from granting Safari access to any file. Apple generally tries to restrict what isn’t necessary, and that can sweep in cases like this. Most Mac users aren’t previewing HTML pages. Because Apple has this broad approach, it means there’s no value in malware creators trying to target opening an HTML page within Safari as a vector to exploit.

safari can't open local html file

You can bypass this security measure using these steps:

  • Open System Preferences > Security & Privacy or System Settings > Privacy & Security .
  • Click Full Disk Access .
  • At the bottom of the list, click the + (plus) icon.
  • Select Safari from the Applications folder.

Now try to load that HTML page again, and you’ll find Safari can handle it.

Ask Mac 911

We’ve compiled a list of the questions we get asked most frequently, along with answers and links to columns: read our super FAQ to see if your question is covered. If not, we’re always looking for new problems to solve! Email yours to  [email protected] , including screen captures as appropriate and whether you want your full name used. Not every question will be answered, we don’t reply to email, and we cannot provide direct troubleshooting advice.

Author: Glenn Fleishman , Senior Contributor

safari can't open local html file

Glenn Fleishman ’s most recent books include Take Control of iOS and iPadOS Privacy and Security , Take Control of Calendar and Reminders , and Take Control of Securing Your Mac . In his spare time, he writes about printing and type history . He’s a senior contributor to Macworld , where he writes Mac 911.

Recent stories by Glenn Fleishman:

  • Downgrading iCloud+ storage? Be sure to retrieve your files properly
  • How to make noncontiguous selections in Pages, Numbers, and Keynote
  • How to take advantage of Preview’s form-filling helper in macOS

Opening HTML in Safari from local file or string

I need to understand if this is feasible.

I need to open a local HTML file placed in the temporary folder of an iOS Swift app in Safari, from the app itself.

At present time I know it is possible to open an Url in Safari, but I am asking about

1- using the file:/// scheme (like Android does)

2- providing directly the HTML text

I have this specific need not to use the WKWebView because I want that the user can exploit features like saving credentials, caching and so on.

I do not know if the WKWebView is able to provide this kind of features, and I do not want to have this kind of features directly in my app for security concerns.

Also other workarounds or solutions are welcome.

Thanks in advance

  • Safari and Web

Man i'am searching the same, I want to open an local file HTML in safari.... have you find a way??? I'm blocked right now

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Open local files on Safari

I would like to know if there is a way (i.e. plugin) to open local files on Safari as i am used to do with FF or IE. Suggestions anyone?

EDIT: I do not want to open the file using "Open->File", but i want my CMS to be able to open local files from a CMS-context.

Oliver Salzburg's user avatar

3 Answers 3

By CMS open local files, I presume you mean that you want the CMS to supply a file system type URI to the browser, that is compatible with all the browsers in your environment.

If that is the case then what Chopper3 said should work.

If you really want the CMS to open files - i.e. serve up URLs to locally stored files, then you will have a bigger challenge, as this may well be different depending on where the browser is running - e.g. same machine as CMS/Web Server or other machines.

dunxd's user avatar

file:// is considered a security threat by some and as a result will not work in some browsers. In Safari a manually typed link to file:///Users/me/file.jpg will work but it will not work in a link tag in your code.

rjmoggach's user avatar

That said, it's just file:///{drive letter}:/{path}/{filename} in the url bar.

Sathyajith Bhat's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged safari ..

  • The Overflow Blog
  • The reverse mullet model of software engineering
  • Reshaping the future of API platforms
  • Featured on Meta
  • Our Partnership with OpenAI
  • Imgur image URL migration: Coming soon to a Stack Exchange site near you!

Hot Network Questions

  • Teaching job application: Should I make any references to a gap year in my employment history due to depression?
  • Which distances can I run on my treadmill?
  • How does ignorance make a barren waste in "To the Nile" by John Keats?
  • Do members of the Church of Jesus Christ of Latter-day Saints believe in self-defense?
  • Can changelings instantly change their hairstyle?
  • Is it more expensive to self publish or use a publisher?
  • Can I provide sunlight many hundred meters below ground or underwater
  • Can the "Flying Whales" cargo airship really hover to be able to lift freight on board?
  • Why wouldn't the world have advanced warning of a significant asteroid/comet strike?
  • "Is he not the carpenter's son?" v.s. "Is not he the carpenter's son?"
  • Unity Gain Amplifier Purpose
  • Who changes `/proc/sys/kernel/random/boot_id` in Linux (SLES)?
  • What is the purpose of these fat copper coils wrapped around … something?
  • Author and book title that includes "The Slow Ones"
  • If gravity is not a force, what makes massive objects spheroid?
  • A novel about people most of whom are more or less color blind
  • Can I use two prepositions with the same noun when one takes the dative and the other the accusative?
  • Can Blindness/Deafness Condition caused by Find Familiar etc be removed by Lesser Restoration?
  • Can the absense of something be a cause?
  • What would be the best way of preparing lasagne in advance?
  • Mt. 15:21-28 vs. Mt. 10:5 - What was Jesus doing in the region of Tyre and Sidon?
  • Gross asymmetry in Maxwell Equations
  • Why should I not believe there are true contradictions?
  • How do computers prevent computational errors?

safari can't open local html file

  • Home New Posts Forum List Trending New Threads New Media Spy
  • WikiPost Latest summaries Watched WikiPosts
  • Support FAQ and Rules Contact Us

Is it possible to open local files by iPad browsers?

  • Thread starter powerbooks
  • Start date Jul 17, 2010
  • Sort by reaction score
  • iPhone, iPad, and iPod Touch

macrumors regular

  • Jul 17, 2010

I asked this question before somewhere in the forum but did not remember an answer. I always set my web browsers with a local "bookmark" file as the homepage, so every time I start a browser I can have quick (lazy) access to the sites of interest by clicking, which is much easier than "dragging" the bookmark menu on a laptop. Since Apple "disabled" the file:///, or local:// command in mobile Safari, I am wondering if there is any other browser that can enable these functions so I can have a bookmark file saved somewhere in my iPad or iPhone. Or is there any "jailbreak" features that may allow to do so, or even open local photos in browser? Thanks!  

macrumors member

  • Jul 18, 2010

I would like to know the answer too I use email and good reader to access files  

mgamber

macrumors 6502a

I don't think it's possible unless you jailbreak. If Safari can't do it, and last time I checked it couldn't, then no other browser will, either, since they're all based on the same WebKit code and the approved API doesn't allow direct file access to anywhere. If you jailbreak, try iFile.  

mgamber said: I don't think it's possible unless you jailbreak. If Safari can't do it, and last time I checked it couldn't, then no other browser will, either, since they're all based on the same WebKit code and the approved API doesn't allow direct file access to anywhere. If you jailbreak, try iFile. Click to expand...

File location file:///var/mobile/Library/Mail/Attachments/test/Transfer.html. This is the pathname of an email attachment called transfer.HTML  

rphiggins said: file:///var/mobile/Library/Mail/Attachments/test/Transfer.html. This is the pathname of an email attachment called transfer.HTML Click to expand...

johnniewalker

Can GoodReader do this?  

The File Browser app can access files on other computers and open native files.  

macrumors newbie

  • Jun 3, 2011

It Can Be Done... ...but only by JB. "file:// schema" will embed in mobile substrate so it will work on all firmware.  

  • Nov 30, 2014
powerbooks said: I asked this question before somewhere in the forum but did not remember an answer. I always set my web browsers with a local "bookmark" file as the homepage, so every time I start a browser I can have quick (lazy) access to the sites of interest by clicking, which is much easier than "dragging" the bookmark menu on a laptop. Since Apple "disabled" the file:///, or local:// command in mobile Safari, I am wondering if there is any other browser that can enable these functions so I can have a bookmark file saved somewhere in my iPad or iPhone. Or is there any "jailbreak" features that may allow to do so, or even open local photos in browser? Thanks! Click to expand...
  • Jul 23, 2015

iFile, a jailbreak-only app will let you browse through a hyperlinked set of HTML documents in a local folder, if that is the type of local file you are talking about. which is awesome, because safari will not.  

If Safari doesn't open a page or work as expected on your Mac

If Safari doesn't load a webpage, stops responding, quits unexpectedly, or otherwise doesn't work as expected, these solutions might help.

These solutions are for issues that can affect Safari on Mac, including issues such as these:

A webpage is blank, doesn't load all of its content, or otherwise doesn't work as expected.

You can't sign in to a webpage, despite using the correct sign-in information.

A webpage asks you to remove or reset cookies.

Safari slows down, stops responding, or quits unexpectedly.

Reload the page

From the menu bar in Safari, choose View > Reload Page. Or press Command-R.

If Safari doesn't reload the page, quit Safari, then try again. If Safari doesn't quit, you can press Option-Command-Esc to force Safari to quit .

If Safari automatically reopens unwanted pages, quit Safari, then press and hold the Shift key while opening Safari. Learn how to control which windows Safari automatically reopens .

Install software updates and restart

Update macOS , which can include updates for Safari. If your Mac didn't restart automatically, choose Apple menu  > Restart. Some important background updates take effect only after restarting.

Check Safari extensions

If you installed any Safari extensions, turn extensions off. From the menu bar in Safari, choose Safari > Settings (or Preferences). Click Extensions, then deselect each extension to turn it off. Learn more about Safari extensions .

If you find that an extension is causing the issue, make sure that the extension is up to date.

Test with a private window

A website can store cookies, caches, and other data on your Mac, and issues with that data can affect your use of the website. To prevent the website from using that data, view it in a private window: From the menu bar in Safari, choose File > New Private Window, or press Shift-Command-N.

If that works, use the following steps to remove the website's data, including its caches and cookies. The website can then create new data as needed. If it's a website that you sign in to, make sure that you know your sign-in information before continuing.

Choose Safari > Settings (or Preferences), then click Privacy.

Click Manage Website Data.

Select the affected website from the list shown.

Click Remove.

Click Done.

Open the website again in a non-private browser window.

Check Safari settings

The webpage might not be compatible with one or more browser settings, which you can turn on or off as needed. From the menu bar in Safari, choose Safari > Settings (or Preferences). Then click Websites, Privacy, or Security to access these settings:

Privacy settings . These settings apply to all websites. For example, a website might require that you allow cross-site tracking, show your IP address, or allow cookies.

Security settings . These settings apply to all websites. For example, a website might require that you enable JavaScript.

Websites settings . These settings can be configured for specific websites. For example, a website might require that you allow pop-up windows, allow downloads, allow access to your camera or microphone, or turn off content blockers.

Check iCloud Private Relay

If you subscribe to iCloud+ and are using its Private Relay feature, try reloading the page without Private Relay: From the menu bar in Safari, choose View > Reload and Show IP Address. This menu item appears only when Private Relay is turned on for your network. Learn more about iCloud Private Relay .

Check VPN or other security software

If you installed VPN or other software that monitors or interacts with your network connections, that software could affect your use of the website or the internet. Learn about network issues related to VPN and other software .

Check network settings

Certain network settings, such as custom proxy settings or custom DNS settings , can affect access to content on the internet. Even if you haven't changed these or other network settings yourself, you might have installed software that changed them for you.

To find out whether the issue is with the network settings on your Mac, try viewing the page from a different web browser or different device on the same network. Or reset your network settings by setting up a new network location on your Mac.

If the issue affects other devices and web browsers on the same network, the issue is probably with the website, and you should contact the website developer for help.

If the issue continues to affect only a particular webpage, contact the website developer for help.

Learn how to block pop-up ads and windows in Safari .

Learn what to do if your iCloud or Safari bookmarks aren't syncing .

safari can't open local html file

Related topics

safari can't open local html file

Explore Apple Support Community

Find what’s been asked and answered by Apple customers.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

klwpfjone

Why can't Safari open this HTML file online?

https://www.comp.nus.edu.sg/~adi-yoga/CS2030S/Slides/L00.html#1

I am unable to open this file on Safari, but when I copy and paste it onto Chrome/other browsers it works fine.

MacBook Pro Apple Silicon

Posted on Aug 11, 2022 5:16 PM

Similar questions

  • Safari on Mac converts sites to pages On Safari, when I click a link in a webpage, it always converts to a standalone read format doc, and I can click no more. 290 1
  • Each time I launch Safari it asks for the location of index.html to load the file This stops Safari from working altogether. 154 2
  • How do I open a .webarchive file I'm using safari I visit a webpage using a URLwhich I know from memory because it's a hidden page on a site that does not allow indexing. It works fine in safari and is actually a text file, I then click File/Save as , and A message says I cannot save this text file. Why, what is the reasoning, that's bizzaire? But lets proceed, It says I can save the file as a WebArchive or "Both", When I click "Both" it still only saves 1 file, what's going on here What do I open the webarchive with so I can get to the text later when offline? Or was that the point? Basically the file won't open. A bit lost, this works in Windows, but still learning to do stuff on MacOS. 5679 2

Loading page content

Page content loaded

Sparks0829

Aug 13, 2022 11:36 AM in response to klwpfjone

Hi there klwpfjone,

If you're having difficulty accessing a specific website in Safari on your Mac, there are some steps you can try. Start by reloading the page:

Reload the page
To reload a page, choose View > Reload Page, or press Command-R. If you can't reload,  make sure that you're connected to the internet .
If you still can't reload:
1. Press Command-Q to quit Safari. If Safari doesn't quit, press Option-Command-Esc to  force Safari to quit .
2. Open Safari again and try to load the page. When Safari opens, if it automatically opens pages that you don't want to open, quit Safari again, then press and hold the Shift key while opening Safari. 

If you still can't access the website, work through the remaining steps in this support article: If Safari on Mac doesn't open a webpage or isn’t working as expected

Aug 13, 2022 4:59 PM in response to klwpfjone

Neither of the above steps work, I think it could be due to Safari not being able to open certain javascript sites. Is there any workaround to this?

Eric Root

Aug 13, 2022 6:36 PM in response to klwpfjone

In Safari/Preferences/Security/Web content is Enable JavaScript checked?

Aug 13, 2022 10:34 PM in response to Eric Root

Yup it is enabled. Are you able to access that HTML file?

Aug 14, 2022 11:42 AM in response to klwpfjone

I can't get the page to load using that link.

COMMENTS

  1. How to open a local HTML file in Safari on an iPad

    5. Turns out Microsoft Edge, unlike Safari, can still open local html files. Discovered . To wit: Install Microsoft Edge from the App Store. Open Files (or whatever file browsing app you like). Open the file, then tap the Share button to send to another app. Scroll across to "More...", choose Edge, and voila!

  2. Safari not opening local html files after upgrading to macOS Catalina

    Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site

  3. safari cannot open local html file

    Goto Text Edit > Preferences. Then under 'New Document', select 'Plain text'. And under 'Open and save', Check both 'Display html file as html code' and 'Display RTF file as RTF code'. Uncheck 'Add ".txt" ' option. Then save your html code in TextEdit in .html format. This should work for Chrome and Safari. safari cannot open local html file.

  4. How to view HTML local file on IPAD

    Locate the file. When i used to click on it it used to work perfectly fine. Within the app itself. No browser needed. But suddenly after updating the app all the html folders i have stopped working. I also tried documents pro app: no luck. goodreader app: it opens the file but freezes and the app stops responding after.

  5. How can I open local HTML files on my iPh…

    Instead, you can save the websites to your Reading List. To enable offline reading of items in the list, go to Settings > Safari, then turn on Automatically Save Offline (below Reading List). Save webpages to read later in Safari on iPhone - Apple Support. Mark92630 wrote: Is it possible to store the HTML files of a website on my iPhone, and ...

  6. Enable local file access on Safari: iOS, iPhone, on iPad

    By default, Safari web browser doesn't allow access to local files. It is only possible if you already have enabled the Develop menu. To enable local file access on Safari: How to enable Safari local file access on a Mac? Open the Safari browser and click on Develop in the upper menu.

  7. How to Open HTML Files on iPhone

    To open an HTML file saved on your iPhone, open the Files app on iOS. When the app opens, tap on the Browse tab at the bottom and select On My iPhone under "Locations". Inside On My iPhone, go to the folder or location, you may have saved the HTML file, possibly the Downloads folder. When you locate it, tap on the HTML file to open it.

  8. Allow local HTML files' scripts to load other local files

    I double-click index.html in Finder. it opens an HTML page in Safari (url is file:///...) it runs a JavaScript that requests another relative file (e.g. (new XMLHttpRequest()).open('GET', './data.json') console is full of "cannot load file:///.../index.js due to access control checks" etc. errors. I know I can start a static webserver in the ...

  9. How Can I view My local/offline Html file on Ipad

    Locate the file. When i used to click on it, it used to work perfectly fine. Within the app itself. No browser needed. But suddenly after updating the app all the html folders i have stopped working. I also tried documents pro app: no luck. goodreader app: it opens the file but freezes and the app stops responding after.

  10. Can't open HTML pages in Safari? Add Safari to Full Disk Access

    There's no real risk from granting Safari access to any file. Apple generally tries to restrict what isn't necessary, and that can sweep in cases like this. Most Mac users aren't previewing ...

  11. Opening HTML in Safari from local …

    I need to open a local HTML file placed in the temporary folder of an iOS Swift app in Safari, from the app itself. At present time I know it is possible to open an Url in Safari, but I am asking about. 1- using the file:/// scheme (like Android does) 2- providing directly the HTML text. I have this specific need not to use the WKWebView ...

  12. Open local files on Safari

    1. By CMS open local files, I presume you mean that you want the CMS to supply a file system type URI to the browser, that is compatible with all the browsers in your environment. If that is the case then what Chopper3 said should work. If you really want the CMS to open files - i.e. serve up URLs to locally stored files, then you will have a ...

  13. ios

    8. I want to open a local html file on Safari integration on my Swift 3 application. I know how to do this with an url. This is the code that I use to do that: let encodedString = url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) let svc = SFSafariViewController(url: NSURL(string: encodedString!) as! URL)

  14. trying to open .html file in safari

    To change an existing rtf file to plain text. Press Command-A to select everything in the file and then go to the Format menu and choose "Make Plain Text". Save the file. Having an htm (l) extension is as much for human convenience as it is for a browser. Having an html extension will allow a file to be loaded into a browser by default, but if ...

  15. Is it possible to open local files by iPad browsers?

    Jul 18, 2010. #3. I don't think it's possible unless you jailbreak. If Safari can't do it, and last time I checked it couldn't, then no other browser will, either, since they're all based on the same WebKit code and the approved API doesn't allow direct file access to anywhere. If you jailbreak, try iFile.

  16. .htm and .html files won't render in Safari or Chrome

    Open TextEdit Preferences (Click on TextEdit at the top-left and select Preferences. Or use the keyboard shortcut CMD + ,) In the New Document select plain text for the format. In the Open and Save check the option that starts Display HTML files... Once you make these changes, you can copy your HTML code into a new TextEdit and save the file ...

  17. Can I save an HTML file to my iPhone and open in Safari?

    Once the page is opened on your iPhone all you have to do is tap the Sharing icon, middle icon on bottom, and select 'Add to Home Screen'. If you want to load an html file that you've created on you Mac to your iPhone you'll need to do the following. From System Prefs > Sharing > Enable Web Sharing. Place the html file in your ~/Sites folder.

  18. If Safari doesn't open a page or work as expected on your Mac

    Reload the page. From the menu bar in Safari, choose View > Reload Page. Or press Command-R. If Safari doesn't reload the page, quit Safari, then try again. If Safari doesn't quit, you can press Option-Command-Esc to force Safari to quit. If Safari automatically reopens unwanted pages, quit Safari, then press and hold the Shift key while ...

  19. Applescript open local HTML file with Safari

    0. I'm trying to open a local html using Safari with the following script: on run. set myPath to (path to me) as text. set myFolderPath to POSIX file (do shell script "dirname " & POSIX path of quoted form of myPath) & ":" as string. set _thispath to myFolderPath & "data:Default.html". tell application "Safari".

  20. Why can't Safari open this HTML file onli…

    To reload a page, choose View > Reload Page, or press Command-R. If you can't reload, make sure that you're connected to the internet.If you still can't reload:1. Press Command-Q to quit Safari. If Safari doesn't quit, press Option-Command-Esc to force Safari to quit.2. Open Safari again and try to load the page.

  21. How to open local html files in safari?

    I want to show the local HTML file in Safari because my users are able to send their HTML files as a PDF in the options menu For this reason: var htmlFile:File = File.documentsDirectory.resolvePath(& ... Open local html file with Safari. 1 Launching an HTML/Javascript Adobe Air application from a local HTML file. 0 ...