X
Tap here to go to the mobile version of the site.

Support Forum

Is it possible to view websites from local hard drive

Posted

I like to test my web pages as much as possible at home before uploading to a server. I do this by setting up empty drive partitions for my various sites, so that 'root level" access will work similarly on a server or from the hard drive. So, for example, a line on a page like...

<script src="/scripts/siteScripts2.js"> </script>

or

<link rel="stylesheet" type = "text/css" href="/styles/fonts/fonts.css"> <link rel="stylesheet" type = "text/css" href="/styles/spcPageStyles1.css" >

Will reference the files from the root level, as if it was on a server.This works all the time with Chrome and IE, even back to IE-8. So Mozilla Firefox must be blocking file references from local hard Drive root level. If there is a config variable or two I can set to allow it from firefox, I'd appreciate knowing about it. I'm satisfied testing with Chrome and IE, but FF is an important browser to test with.

Thanks in advance!

I like to test my web pages as much as possible at home before uploading to a server. I do this by setting up empty drive partitions for my various sites, so that 'root level" access will work similarly on a server or from the hard drive. So, for example, a line on a page like... <script src="/scripts/siteScripts2.js"> </script> or <link rel="stylesheet" type = "text/css" href="/styles/fonts/fonts.css"> <link rel="stylesheet" type = "text/css" href="/styles/spcPageStyles1.css" > Will reference the files from the root level, as if it was on a server.This works all the time with Chrome and IE, even back to IE-8. So Mozilla Firefox must be blocking file references from local hard Drive root level. If there is a config variable or two I can set to allow it from firefox, I'd appreciate knowing about it. I'm satisfied testing with Chrome and IE, but FF is an important browser to test with. Thanks in advance!

Chosen solution

'Root' level access via "/styles/fonts/fonts.css" works relative to the folder where the HTML file is located. You can't go back in the directory tree to access other folders starting with root.

Read this answer in context 1
Quote

Additional System Details

Installed Plug-ins

  • ActiveTouch General Plugin Container Version 105
  • Adobe PDF Plug-In For Firefox and Netscape "9.5.2"
  • GEPlugin
  • Google Update
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Next Generation Java Plug-in 11.45.2 for Mozilla browsers
  • DRM Store Netscape Plugin
  • DRM Netscape Network Object
  • Shockwave Flash 32.0 r0
  • 5.1.30514.0
  • VLC media player Web Plugin
  • Npdsplay dll
  • Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
  • iTunes Detector Plug-in

Application

  • User Agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0

More Information

WestEnd
  • Top 25 Contributor
61 solutions 5303 answers

If you writing your own page there should be something in the software you using to preview or test the page. You should check with the software maker your using to write your web page to see if they have a built in function to do that. I know most should as this helps them revise or redo pages before uploading as well.

If you writing your own page there should be something in the software you using to preview or test the page. You should check with the software maker your using to write your web page to see if they have a built in function to do that. I know most should as this helps them revise or redo pages before uploading as well.
Was this helpful to you? 0
Quote

Question owner

Thanks @Westend, but since both Chrome and IE (at least older versions) do allow you to properly load and view a site on your local drive, and even treat "root level" links as if they just referred to the root level of the hard drive (EG: D:\ or E:\), I'd just like to know why I can't do the same with Firefox, and whether there is a simple configuration change that will allow it.

I'm a hand coder so there is no special software I use for development. But even if I did, when I say "test" pages, I mean I like to see how the page will appear in various browsers and versions of browsers. Even if I used special software that allowed a browser view, it would not accurately simulate Chrome, Firefox, IE (various versions) or safari. If all browsers identically implemented CSS and their internal DOM, testing with just one browser would be enough.

Thanks @Westend, but since both Chrome and IE (at least older versions) do allow you to properly load and view a site on your local drive, and even treat "root level" links as if they just referred to the root level of the hard drive (EG: D:\ or E:\), I'd just like to know why I can't do the same with Firefox, and whether there is a simple configuration change that will allow it. I'm a hand coder so there is no special software I use for development. But even if I did, when I say "test" pages, I mean I like to see how the page will appear in various browsers and versions of browsers. Even if I used special software that allowed a browser view, it would not accurately simulate Chrome, Firefox, IE (various versions) or safari. If all browsers identically implemented CSS and their internal DOM, testing with just one browser would be enough.
Was this helpful to you?
Quote
cor-el
  • Top 10 Contributor
  • Moderator
17273 solutions 156143 answers

Chosen Solution

'Root' level access via "/styles/fonts/fonts.css" works relative to the folder where the HTML file is located. You can't go back in the directory tree to access other folders starting with root.

'Root' level access via "/styles/fonts/fonts.css" works relative to the folder where the HTML file is located. You can't go back in the directory tree to access other folders starting with root.
Was this helpful to you? 1
Quote

Question owner

cor-el said

'Root' level access via "/styles/fonts/fonts.css" works relative to the folder where the HTML file is located. You can't go back in the directory tree to access other folders starting with root.

Yes...thanks... I've found that too. while updating my pages, I'd heard repeatedly (though I don't know why) that it better to reference things to the root, and even use full URLs. I didn't do the latter, but I did start referencing all resources to the "/" root, and thans when it broke Firefox's ability to render the pages with links styles and JS scrips. Its just odd that Chrome and the lowly IE (at least my versions) do allow it. I guess I'll just live with it. Thanks.

''cor-el [[#answer-1196592|said]]'' <blockquote> 'Root' level access via "/styles/fonts/fonts.css" works relative to the folder where the HTML file is located. You can't go back in the directory tree to access other folders starting with root. </blockquote> Yes...thanks... I've found that too. while updating my pages, I'd heard repeatedly (though I don't know why) that it better to reference things to the root, and even use full URLs. I didn't do the latter, but I did start referencing all resources to the "/" root, and thans when it broke Firefox's ability to render the pages with links styles and JS scrips. Its just odd that Chrome and the lowly IE (at least my versions) do allow it. I guess I'll just live with it. Thanks.
Was this helpful to you?
Quote

Question owner

Note that I've purposely dedicated a drive partition entirely to the site I'm working on. So If the site page is at E:\mypage.html, a link to ""/styles/fonts/fonts.css" should work, because that is EXACTLY where the fonts.css file is. And as i said, it WORKS in Chrome and IE. But not in FF!

Note that I've purposely dedicated a drive partition entirely to the site I'm working on. So If the site page is at E:\mypage.html, a link to ""/styles/fonts/fonts.css" should work, because that is EXACTLY where the fonts.css file is. And as i said, it WORKS in Chrome and IE. But not in FF!
Was this helpful to you?
Quote

Question owner

Finally, I'm sure at this point that the inability of FF to access the kind of embedded links to root level resources I've described is NOT a bug, but intentional. I'm sure it is a security measure. So what I would like to know is, how do i request the software authos reconsider this block, and and allow developers (who surely KNOW the risks ) to override it with a setting or config variable?

Finally, I'm sure at this point that the inability of FF to access the kind of embedded links to root level resources I've described is NOT a bug, but intentional. I'm sure it is a security measure. So what I would like to know is, how do i request the software authos reconsider this block, and and allow developers (who surely KNOW the risks ) to override it with a setting or config variable?
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.