close panorama


Local / Offline Usage

Today many web-browsers have several restrictions when running interactive content locally. 'Locally' means when opening a html file directly from the local file-system in the browser. In the browsers address bar local files can be identified by their file:// url.

When trying to run a local html file, the browser might restrict scripted access to other local files. And because of this dynamically loading xml, js or image files might be not possible.

Solutions



Using a localhost server

A localhost server is an application that runs a web-server locally on the system and provides access to the local files by http:// or https:// addresses. This way the file access is the same as when running online on an web-server.

This has also the advantage that other systems and devices in the same local networks (e.g. mobile devices in the same wifi) could also access the files by using the localhost server address.

krpano includes two special and easy-to-use localhost server applications. One GUI application and one command-line application. More information here: krpano Testing Server

Changing the browser settings

It would be possible to change the browsers settings to allow local file access, but as this would affect the whole browser and all pages, this is not generally recommended and should be only used for testing.
  • Firefox

    Before Firefox 68:
    • Notthing todo in this case, that browser is allowing access to the local files in the same folder as the origin html file by default.
    For Firefox 68 and newer:
    1. Enter about:config in the browsers address bar.
    2. Then enter security.fileuri.strict_origin_policy in search bar on that config page to filter the available settings.
    3. Change that setting to false.
    4. After that access to local files should be possible, restarting the browser should be not necessary.
  • Chrome

    Chrome would need to be started with --allow-file-access-from-files as argument. To do this:

    On Windows:
    1. Make a new shortcut/link icon to Chrome somewhere (e.g. by right-clicking it).
    2. Edit the proprieties of that new link (also by right-clicking it).
    3. Add --allow-file-access-from-files into the file path after Chrome.exe (make sure there is a blank between).
    4. Restart Chrome using that new icon (but make sure to close all currently opened Chrome windows before doing that).
    On Mac:
    1. Close all currently opened Chrome windows.
    2. Open the Terminal.
    3. Enter this line:
      open /Applications/Google\ Chrome.app --args --allow-file-access-from-files
  • Safari (Mac)

    1. In the Safari Settings enable the Developer Menu in the Advanced tab.
    2. Then there will be a new Develop Menu in the Menubar.
    3. There enable the 'Disable Local File Restrictions' option.

Building a standalone Desktop App

There are tools like NW.js or Electron available that allow building standalone Desktop applications that run webcontent. Especially NW.js is easy to setup, so here example instructions for it:

For Windows:
  1. Download NW.js from here: https://nwjs.io/.
  2. Extract it anywhere.
  3. As example: build a tour using the MAKE VTOUR droplet and copy the vtour folder into the extracted nwjs folder.
  4. Create a file named package.json inside the nwjs folder (any texteditor will do) with the following content:
    {"name":"My tour", "main":"vtour/tour.html"}
    This file tells NW.js which file to load when starting it.
  5. Then just click the nw.exe to start the tour.
  6. The nw.exe file could be also renamed to any other name.
For Mac:
  1. Download NW.js from here: https://nwjs.io/.
  2. Right-click the nwjs application to show its package content.
  3. Go there first into the Contents and then into Resources folder.
  4. Make there a new folder named app.nw.
  5. As example: build a tour using the MAKE VTOUR droplet and copy the vtour folder into that app.nw folder.
  6. Create a file named package.json also inside the app.nw folder (any texteditor will do) with the following content:
    {"name":"My tour", "main":"vtour/tour.html"}
    This file tells NW.js which file to load when starting it.
  7. Then just click the nwjs to start the tour.
  8. The nwjs file could be also renamed to any other name.

More information here in the krpano Forum.