Has anyone tried to use JAPE in offline mode? I downloaded the archive and unzipped to my PSION folder; but it seems the relative paths are incorrect. I've tried fiddling with a bit of the .htm files but I'm a bit out of my depth...
I've tried in both Mozilla Firefox and Microsoft Edge. Here's the errors I get:
I Can't Use JAPE in Offline Mode
- Zenerdiode
- Posts: 44
- Joined: Wed Jan 04, 2023 12:45 am
- Location: Newcastle, England
I Can't Use JAPE in Offline Mode
You do not have the required permissions to view the files attached to this post.
Christopher. - Check out my TRAP message, it’s not difficult to decode and is sometimes uttered under the breath when said message appears…
-
- Posts: 205
- Joined: Tue Jan 03, 2023 7:54 pm
Re: I Can't Use JAPE in Offline Mode
The only time I used Jape offline was when I ported the 6303 processor part over to C and ran it in parallel with the one that runs on the RP Pico on the recreated Organiser board. I used it to verify that my emulator was actually working. It does now, I found a couple of bugs in my emulator that way, and one in Jape. This was done on Linux as a stand-alone emulator, as the recreation emulator can run as a Linux executable as well.
Not much help for what you are doing, I know. I didn't get the web code to run locally. I don't think I tried.
Regards
Andrew
Not much help for what you are doing, I know. I didn't get the web code to run locally. I don't think I tried.
Regards
Andrew
-
- Posts: 46
- Joined: Wed Jan 04, 2023 7:51 pm
Re: I Can't Use JAPE in Offline Mode
Zenerdiode,
I've used Jape offline before, but it was a few years ago. I tried it again now and got the same errors you've shown, so after a few hours of trying to understand the Javascript, I found a couple of solutions which don't require any modifications to the code. I think these errors are appearing now and didn't before because of changes to security settings in modern browsers. If you try an older PC or browser version the problem may go away.
Firstly, it's good to put your browser into developer mode. With Chrome this is done (after clicking ok on those errors) by right clicking the mouse and selecting Inspect, this allows you to see the Javascript console and execution error messages.
It reveals the error:
The pop-up file errors are generated in Jaap's binaryfile.js part of the code. binaryfile.js is trying to use the command XMLHttpRequest() to load the binary files, but the CORS policy prevents it.
One way to avoid the errors is to run Chrome in a special mode, selectable at the command line:
Search your PC to find where chrome.exe is located, mine was in:
C:\Program Files (x86)\Google\Chrome\Application
Next, open a command window, in Windows this is done by typing cmd in the search bar
change directory to the one with Chrome, using the cd command, e.g. cd C:\Program Files (x86)\Google\Chrome\Application
then enter the following to run chrome with file access:
.\chrome.exe --allow-file-access-from-files
Running Chrome like this is not recommended as it puts you at risk from viruses and such, but if you only do it when you're offline and close the browser straight after running Jape, I don't think there's much danger.
A safer alternative is to run an http server on your PC to allow access to the folder where Jape is located, which will satisfy the security constraints.
The easiest way I've found to do that is to use Python, if you don't have python on your PC, you can download it from: https://www.python.org/downloads/
Choose to install it in some easy to find folder, such as C:\Python3, then in a command window navigate to the folder where you have your Jape files, then type the following:
C:\python3\python -m http.server
This will start a local server with the files from the current folder, you may get some firewall permission pop-ups, I just ok'd them.
Then in your browser address bar type:
http://localhost:8000/jape.htm
Then Jape should run ok.
Martin P.
I've used Jape offline before, but it was a few years ago. I tried it again now and got the same errors you've shown, so after a few hours of trying to understand the Javascript, I found a couple of solutions which don't require any modifications to the code. I think these errors are appearing now and didn't before because of changes to security settings in modern browsers. If you try an older PC or browser version the problem may go away.
Firstly, it's good to put your browser into developer mode. With Chrome this is done (after clicking ok on those errors) by right clicking the mouse and selecting Inspect, this allows you to see the Javascript console and execution error messages.
It reveals the error:
Googling the "CORS policy" is the clue to finding out what's wrong.Access to XMLHttpRequest at 'file:///C:/jape/other/fdrive19.bin' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted
The pop-up file errors are generated in Jaap's binaryfile.js part of the code. binaryfile.js is trying to use the command XMLHttpRequest() to load the binary files, but the CORS policy prevents it.
One way to avoid the errors is to run Chrome in a special mode, selectable at the command line:
Search your PC to find where chrome.exe is located, mine was in:
C:\Program Files (x86)\Google\Chrome\Application
Next, open a command window, in Windows this is done by typing cmd in the search bar
change directory to the one with Chrome, using the cd command, e.g. cd C:\Program Files (x86)\Google\Chrome\Application
then enter the following to run chrome with file access:
.\chrome.exe --allow-file-access-from-files
Running Chrome like this is not recommended as it puts you at risk from viruses and such, but if you only do it when you're offline and close the browser straight after running Jape, I don't think there's much danger.
A safer alternative is to run an http server on your PC to allow access to the folder where Jape is located, which will satisfy the security constraints.
The easiest way I've found to do that is to use Python, if you don't have python on your PC, you can download it from: https://www.python.org/downloads/
Choose to install it in some easy to find folder, such as C:\Python3, then in a command window navigate to the folder where you have your Jape files, then type the following:
C:\python3\python -m http.server
This will start a local server with the files from the current folder, you may get some firewall permission pop-ups, I just ok'd them.
Then in your browser address bar type:
http://localhost:8000/jape.htm
Then Jape should run ok.
Martin P.
You do not have the required permissions to view the files attached to this post.