Go to local URL with Javascript

前端 未结 5 481
情话喂你
情话喂你 2020-11-27 07:02

Same question as here but I need to go to local URL\'s in Firefox

I tried with code like

var url = \"file:///E:/Test/Test.htm\";
window.location.href         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 07:05

    You cannot access the file from the local system. Since the Browser works in the sandbox mode and you cannot breach the sandbox and reach the local file system since it would violate the security. Either try to directly load using an AJAX request else what you are trying to do is not possible due to sandbox restrictions and also does not comply with the security policies.

提交回复
热议问题