You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/FILES.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,14 @@
1
1
# Perl Executing Browser - Files and Folders
2
2
3
-
PEB is created to work from any directory without installation and all paths used by PEB are relative to the directory of the PEB executable, labeled as ``{PEB_executable_directory}`` within this documentation. Only one folder and two file names are hard-coded in C++ code for compatibility with the [Electron](http://electron.atom.io/) framework.
3
+
PEB is created to work from any directory without installation and all file paths used by PEB are relative to the directory of the PEB executable, labeled as ``{PEB_executable_directory}`` within this documentation.
4
+
5
+
## Application Executable
6
+
7
+
The executable binary file of the browser, ``peb`` or ``peb.exe`` by default, can be renamed with no restrictions or additional adjustments. It can take the name of the PEB-based application it is going to run.
8
+
9
+
## Application Files and Folders
10
+
11
+
The following PEB files and folders are hard-coded in C++ code for faster application startup. The PEB application directory is compatible with the application directory of the [Electron](http://electron.atom.io/) framework.
4
12
5
13
A minimal ``{PEB_executable_directory}`` looks like this:
PEB interactive Perl scripts are able to receive user input multiple times after the script is started by waiting for new data coming either on STDIN or in a temporary file. Many interactive scripts can be started simultaneously in one PEB instance. One script may be started in many instances, provided that each of them has a JavaScript settings object with an unique name.
3
+
PEB interactive Perl scripts are able to receive user input multiple times after the script is started by waiting for new data on STDIN or in a temporary file. Many interactive scripts can be started simultaneously in one PEB instance. One script may be started in many instances, provided that each of them has a JavaScript settings object with an unique name.
4
4
5
5
## Requirements for Interactive Perl Scripts
6
6
@@ -32,10 +32,14 @@ PEB interactive Perl scripts are able to receive user input multiple times after
32
32
33
33
## Examples of Interactive Perl Scripts
34
34
35
-
The [index.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index.html) demonstrates how to start automatically one Perl interactive script using STDIN input in two instances.
35
+
The [index.htm](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index.html)file of the demo package demonstrates how to start automatically one Perl interactive script in two instances.
36
36
37
-
The [interactive.pl script of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive.pl) is an example of a Perl interactive script using STDIN input.
37
+
The [interactive.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive.pl) script of the demo package is an example of a Perl interactive script using STDIN input.
38
38
39
-
The [index-windows.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index-windows.html) demonstrates how to start automatically one Perl interactive script using a temporary filein two instances.
39
+
The [interactive-tempfile.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive-tempfile.pl) script of the demo package is an example of a Perl interactive script using a temporary file. This script creates a temporary file on startup and sends to PEB its full path in the following JSON format:
40
40
41
-
The [interactive-windows.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive-windows.pl) script of the demo package is an example of a Perl interactive script using a temporary file. This script creates a temporary file on startup and sends back to PEB its full path. PEB sends data to the interactive script by forwarding this path and a message text to the STDIN of a helper script, [messenger.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/messenger.pl). The helper script writes all data received from PEB in the temporary file. The interactive script checks periodically its temporary file for any new messages.
41
+
```json
42
+
{"tempfile":"/path/to/tempfile"}
43
+
```
44
+
45
+
PEB sends data to the script by writing in its temporary file and the script checks periodically its temporary file for new messages.
Copy file name to clipboardExpand all lines: doc/SETTINGS.md
+4-12Lines changed: 4 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,13 @@
1
1
# Perl Executing Browser - Settings
2
2
3
-
## Application Filename
4
-
5
-
The executable binary file of the browser, ``peb`` or ``peb.exe`` by default, can be renamed with no restrictions or additional adjustments. It can take the name of the PEB-based application it is going to run.
6
-
7
3
## Global Settings API
8
4
9
5
All global PEB settings are stored in a single JavaScript object named ``pebSettings``. This name is mandatory and hard-coded in C++ code. If ``pebSettings`` JavaScript object is not found, no Perl scripts can be started.
The ``pebSettings`` JavaScript object may have the following properties:
@@ -34,7 +29,7 @@ The ``pebSettings`` JavaScript object may have the following properties:
34
29
``{PEB_executable_directory}/resources/app`` as a root folder.
35
30
If a relocatable Perl interpreter is not configured, PEB will use the first Perl interpreter on PATH.
36
31
37
-
***onStartScripts**
32
+
***autoStartScripts**
38
33
``Array`` of Perl scripts that are started immediately after a local page is loaded
39
34
40
35
***cutLabel**
@@ -64,9 +59,6 @@ The ``pebSettings`` JavaScript object may have the following properties:
64
59
***closeConfirmation**
65
60
``String`` displayed in a JavaScript Confirm popup box when the close button is pressed, but unsaved data in local HTML forms is detected. If no ``closeConfirmation`` object property is found, PEB shuts down all running Perl scripts and exits.
66
61
67
-
***onExitScripts**
68
-
``Array`` of Perl scripts that are invoked before application exit
69
-
70
62
## Perl Scripts API
71
63
72
64
Every Perl script run by PEB has a JavaScript settings object with an arbitrary name and fixed object properties. The name of the JavaScript settings object with a ``.script`` extension forms a pseudo link used to start the Perl script.
@@ -138,7 +130,7 @@ A JavaScript settings object for a Perl script run by PEB has the following prop
138
130
139
131
***inputData**
140
132
``String`` or ``Function`` supplying user data as its return value
141
-
``inputData`` is written on script STDIN.
133
+
``inputData`` is written on script STDIN or in temporary file.
142
134
143
135
``inputData`` function with no dependencies:
144
136
@@ -151,7 +143,7 @@ A JavaScript settings object for a Perl script run by PEB has the following prop
151
143
152
144
***exitData**
153
145
``String`` or ``Function`` supplying script exit command as its return value
154
-
``exitData`` is written on script STDIN.
146
+
``exitData`` is written on script STDIN or in temporary file.
0 commit comments