You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 17th 2014, 2:48pm

Local Krpano application

Hi guys,

i'm trying to build a local krpano application with a virtual tour in it. It should be fully downloadable from chrome store (packaged app) and completely usable offline.
I'm encountering a problem in loading the xml file that cointains tour description (tour.xml).
It loads krpano, but fails loading the xml and I get "FATAL ERROR: tour.xml - loading or parsing failed!"

I read that chrome can't load local xml file, so i have to edit embedpano function to add something like

Source code

1
2
3
4
5
6
7
8
9
10
11
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",'dineshkani.xml',false);
xmlhttp.send();
xmlDocument=xmlhttp.responseText;


Is it possible to edit the main js file autogenerated by MAKE VTOUR droplet? I can pnly get minified version of that file.

Any other suggestion to solve the problem?

Ty in advance

EDIT: I downloaded krpano Protect Tool to generate a .exe file to run the tour embedding all other files. I setup all variables as http://krpano.com/tools/kprotect/#top suggest and I generate the executable file. It loads well the first pano of the tour, but it doesn't load other panos linked from the first: I have an arrow that let the user go on with the tour, but once clicked, nothing happen.

This post has been edited 1 times, last edit by "Ponc" (Mar 17th 2014, 4:44pm)


2

Tuesday, March 18th 2014, 1:37pm

Hi,
Is it possible to edit the main js file autogenerated by MAKE VTOUR droplet? I can pnly get minified version of that file
What do want to achieve or what do you expect from that code?
Skipping the Chrome local file restrictions will be not possible with that of course.

but once clicked, nothing happen.
No error in the log?
Make sure that all files are embedded (the protect tool might not add all automatically).

Best regards,
Klaus

3

Tuesday, March 25th 2014, 5:05pm

What do want to achieve or what do you expect from that code?
Skipping the Chrome local file restrictions will be not possible with that of course.
Chrome packaged app's security policy doesn't allow the use of "eval" in js script. Now I have two scenarios:

1) sandboxing the .html page that execute "embedPano" function: this can avoid "eval" problem, but from sandboxed pages I can't load xml file, due to chrome security settings (check https://code.google.com/p/chromium/issues/detail?id=58151, it's a bit old, but situation isn't changed) and krpano throws an XMLHttpRequest cannot load file:///somePath.xml. Cross origin requests are only supported for HTTP.
So nothing good.... Obv I can't tell to my user to launch Chrome with "--disable-web-security" param.


2) changing createPanoViewer function to avoid use of evals. This way is technically possible (already tryed it). What do you think 'bout it?

Thanks for your answer :)

4

Tuesday, July 1st 2014, 10:10am

What do want to achieve or what do you expect from that code?
Skipping the Chrome local file restrictions will be not possible with that of course.
Chrome packaged app's security policy doesn't allow the use of "eval" in js script. Now I have two scenarios:

1) sandboxing the .html page that execute "embedPano" function: this can avoid "eval" problem, but from sandboxed pages I can't load xml file, due to chrome security settings (check https://code.google.com/p/chromium/issues/detail?id=58151, it's a bit old, but situation isn't changed) and krpano throws an XMLHttpRequest cannot load file:///somePath.xml. Cross origin requests are only supported for HTTP.
So nothing good.... Obv I can't tell to my user to launch Chrome with "--disable-web-security" param.


2) changing createPanoViewer function to avoid use of evals. This way is technically possible (already tryed it). What do you think 'bout it?

Thanks for your answer :)
UP.

Can you please tell me if the solution 2) is allowed?
I really need to run krpano locally and build a Chrome app around it, but that eval is really a problem.

Ty :)

5

Thursday, July 3rd 2014, 11:31am

Hi,

krpano without eval() function is not possible, and modifying the krpano viewer script is not allowed!

Best regards,
Klaus