PharoJS FAQ

PharoJS tests and playground raise on Safari error: SecurityError (DOM Exception 18): The operation is insecure

This error prevents running PharoJS tests with Safari as a default browser. This problem also arises when opening a PharoJS playground on a app (e.g. `PjCounterBrowserApp`).

The cause of the bug is that currently, we open HTML files from the disk. This works fine with Firefox and Chrome. But, Safari's new security system forbids accessing JS global `localStorage` when the HTML or the JS code is loaded from file://

Luckily, there is a workaround. First, ensure you have the Safari developer tools installed. Then, in the `Develop` menu check the "Disable local file restrictions" item.

This is needed only during development. Once your app is ready for production, you export the code and make available on a server. You should not experience the issue.

Don't forget that PharoJS allows building HTML apps. Thus, if you require accessing sensitive resources, you are likely to have to define a content security policy in your HTML file using the meta tag. You can find some examples in the Stack overflow response addressing this question

How do I install PharoJS?

Install can be done inside a Pharo 5 image by evaluating the following in a playground:

Gofer it
smalltalkhubUser: 'noury' project: 'PharoJS';
configurationOf: #PharoJS ;
loadBleedingEdge.

This will install the most recent public version. To install the latest stable version, please use loadStable instead of loadBleedingEdge.

Upon install, Pharo will download HTML code for examples. The are located in the PharoJS-master foloder along with the image and the change file. It contains subfolders for each example and test.

Where can I find the HTML code for App tests (e.g. PjCounterApp and PjMinimalApp)?

Some tests require a folder with HTML + CSS + ... files. They can be found in the PharoJS Git repository: https://github.com/bouraqadi/PharoJS.

Where can I find the PharoJS documentation?

The PharoJS documentation is available in the dedicated page. It includes (but not restricted to) conference papers and slides of talks presenting different facets of PharoJS.

Where can I download the ESUG 2016 Demo (Pharo 4 image + Web App + PhoneGap App)?

Ready to use Pharo 4 image with for the demo of the ESUG 2016 talk. The zip file includes the files (e.g. HTML) for the web app and for the PhoneGap mobile application [ZIP approx. 85 MB]

Are there any PharoJS goodies (Shirts, Mugs...)?

Different PharoJS goodies are available. Please click on the picture below.