Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
This worked fine in all previous versions of macOS.

I set my Safari home page as a local file. Other settings as attached.

Now, when I open Safari, I get the attached "Safari can't open the page" error.

On clicking "Go to homepage (sic)", the home page opens. New tabs also open with the home page.

It should load the home page on start-up.

Am I missing something?
 

Attachments

  • Screenshot 2018-09-24 at 22.16.49.png
    Screenshot 2018-09-24 at 22.16.49.png
    29.4 KB · Views: 328
  • Screenshot 2018-09-24 at 22.18.12.png
    Screenshot 2018-09-24 at 22.18.12.png
    38.1 KB · Views: 164

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
I have a similar issue after updating to Mojave
For sometime Safari was opening my local file with no issues. Since today it's asking to confirm each time I launch Safari if I'm sure to open my file as homepage !! . Did you fix your problem ?
 

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
No, it's still happening, although it's changed to the way you describe. i.e. it opens a modal requesting "Confirm the file to load". This makes no sense, because the file has been selected in Safari's preferences, so of course it's okay to load.

Unfortunately, I had to stop using Safari because of this problem.
 

bogdanw

macrumors 603
Mar 10, 2009
5,695
2,729
Try this: clear history and close Safari, replace ~/Documents/page.htm with the location of your page and in Terminal
Code:
defaults write com.apple.Safari.SandboxBroker Homepage "~/Documents/page.html"
 
  • Like
Reactions: katbel

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
Try this: clear history and close Safari, replace ~/Documents/page.htm with the location of your page and in Terminal
Code:
defaults write com.apple.Safari.SandboxBroker Homepage "~/Documents/page.html"
Thanks, although it didn't work... it got me retesting.

I copied my home page elsewhere, set it in Safari's preferences, closed Safari, opened Safari. All good. Cleared history and caches, closed Safari, opened Safari. All good. Did Open File on original home page and set it in Safari preferences – did the clearing dance a few times – and so far it's working.

So I guess there was a bug setting the Safari home page preference at some point in the past, which seems to have been fixed – fingers crossed.


Sadly, it stopped working again. (I get this on more than one machine, with very different set-ups.)
 
Last edited:

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
It's working for me on 10.14.6 (18G3020) Safari 13.0.5
I usualy have a larger html file, this was just an example.

I found another way: it could have something to do with permissions
When it asked to open the file I saw in the Info window that permissions somehow got wrong
and Staff privilege was No access
I changed to Read Only and it's working again
Screen Shot *.jpg


I will keep in mind your Terminal code in case it goes back to having issues

Thanks though: always a precious tip !
 
  • Like
Reactions: bogdanw

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
Alas after 8 days of perfect opening , since today we are back to the confirmation.
I tried the script suggested by bogdanw, after clearing the history, but doesn't work either.
Permission are the same, nothing has changed beside the behavior.

Another workaround is to start directly from the homepage.html of your choice and not Safari and this way it works.

To make things "fancier" I changed the html page icon to the one from Safari...Now it would be cool to find a way to keep the icon in the dock where it is normally but for now it is on the right side
Just need to get used to it
 
Last edited:

bogdanw

macrumors 603
Mar 10, 2009
5,695
2,729
I do not understand what's happening. For me, it's working in Mojave and Catalina.
It seems the homepage is also set in ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
along with DidMigrateResourcesToSandbox set to Boolean YES (1)
I am not sure if this value matters.
The values can be read with
defaults read ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist DidMigrateResourcesToSandbox
defaults read ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist HomePage
The first returns DidMigrateResourcesToSandbox 1
 

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
I get DidMigrateResourcesToSandbox 1, as you did.

The second returns the file name:
file:///Users/username/Library/Mobile%20Documents/com~apple~CloudDocs/index.html

I wonder if the problem is the 'space' character, which is represented by %20 here.

Changing to
file:///Users/username/Library/Mobile\ Documents/com~apple~CloudDocs/index.html
results in file not found. Interestingly, editing to reinsert %20 causes some bizarre error – Safari won't allow it to be copied <shrug> Instead, it's necessary to go through the Open File dance (which inserts the %20)
 

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
Have you tried putting the file somewhere that does not have a space in the path?
Mine is in Documents and doesn't have any space but I get the same issue.
It always worked then stopped for few days. Worked again and now nothing is changing its behavior
 

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
New experiment: I duplicated the file and saved as .htm, still in Documents
Updated Safari with file to open at start
Today is working .
 

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
New experiment: I duplicated the file and saved as .htm, still in Documents
Updated Safari with file to open at start
Today is working .
I'll try this as well. After a few hours, no issues…
 

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
Still working here too. I will update it in a week hoping to see other uplifting news as well , sigh, for everyone
 

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
It worked here for two days, and then reverted to the original problem – "Confirm the file to load".
 

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
After the update , security and safari I get "Confirm file to load " again
10 days without a glitch, but I'm trying again to duplicate my file-changed its name slightly
and see if the problem had to do with the updating
 
Last edited:

bogdanw

macrumors 603
Mar 10, 2009
5,695
2,729
Thanks bogdanw but doesn't work for me
Based on the problems encountered in setting Back in Safari and others similar, I suspect a lot of these issues are caused by the transition from the old, trusted ~/Library/Preferences to the new containers that mess up permissions.
Giving Safari Full Disk Access might solve the problem, but that might not be a good idea.
 
Last edited:

auxbuss

macrumors 6502
Original poster
Feb 18, 2014
439
322
UK
Giving Safari Full Disk Access might solve the problem, but that might not be a good idea.
I've been trying this since you posted, and it has worked so far.

Note: It didn't work initially. I had to delete the Home Page from Safari's Preferences, and then reassign it – even though it was the same page and thus Preference entry [:shrug]

I'll update here if it breaks again.
 

katbel

macrumors 68040
Aug 19, 2009
3,338
28,806
I've been trying this since you posted, and it has worked so far.

Note: It didn't work initially. I had to delete the Home Page from Safari's Preferences, and then reassign it – even though it was the same page and thus Preference entry [:shrug]

I'll update here if it breaks again.

I tried all suggested , nothing worked but
now inspired by what you wrote
I just deleted the home page from from Safari's Preferences leaving it blank, reopened Safari with a blank one and then reassigned my page without giving full access to Safari and it seems to work.
Who knows ..I will let you know if it last
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.