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: README.md
+24-19Lines changed: 24 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,18 +59,19 @@ Perl Executing Browser (PEB) is an HTML GUI for [Perl 5](https://www.perl.org/)
59
59
60
60
## Features
61
61
**Usability:**
62
-
* Perl 5 scripts can be fed from HTML forms using direct GET and POST or AJAX requests to a built-in pseudo-domain.
63
-
* Output from long running Perl 5 scripts can be seamlessly inserted into the HTML DOM of the calling local page.
64
-
* Linux superuser Perl scripts can be started.
65
-
* Any version of Perl 5 can be used.
66
-
* PEB can be started from any folder.
62
+
*[Perl 5 scripts can be fed from HTML forms using direct GET and POST or AJAX requests to a built-in pseudo-domain](#feeding-from-forms).
63
+
*[Output from long running Perl 5 scripts can be seamlessly inserted into the HTML DOM of the calling local page](#data-only-scripts).
64
+
*[Linux superuser Perl scripts can be started](#calling-linux-superuser-perl-scripts).
65
+
*[Any version of Perl 5 can be used](#runtime-requirements).
66
+
*[PEB can be started from any folder](#settings).
67
67
* PEB is useful for both single-page or multi-page applications.
68
-
* Single file or multiple files, new filename, existing or new directory can be selected by user.
69
-
Their full paths are displayed in the calling local page and they can be supplied to local Perl scripts.
70
-
* Browser functions are accessible from special URLs.
71
-
* Any icon can be displayed on windows and message boxes.
72
-
* Optional JavaScript translation of context menu and dialog boxes.
73
-
* Optional warning for unsaved data in HTML forms before closing a window to prevent accidental data loss.
68
+
*[Single file or multiple files, new filename, existing or new directory can be selected by user](#special-urls-for-users).
69
+
Their full paths can be displayed in the calling local page and they can be supplied to local Perl scripts.
70
+
*[Browser functions are accessible from special URLs](#special-urls-for-users).
71
+
*[Any icon can be displayed on windows and message boxes](#icon).
72
+
*[Optional context menu translation using JavaScript ](#custom-or-translated-context-menu-labels).
73
+
*[Optional translation of the JavaScript *Alert*, *Confirm* and *Prompt* dialog boxes using JavaScript](#custom-or-translated-labels-for-javascript-dialog-boxes).
74
+
*[Optional warning for unsaved data in HTML forms before closing a window to prevent accidental data loss](#checking-for-unsaved-user-input-before-closing-a-window).
74
75
* Cross-site scripting is disabled for all web and local pages.
75
76
76
77
**Development goodies:**
@@ -110,7 +111,7 @@ Compiled and tested successfully using:
110
111
**1. page-producing scripts:**
111
112
They produce complete HTML pages and no special settings are necessary when they are called from a local page. There can be multiple chunks of output from such a script - PEB accumulates them all and displays everything when the script is finished.
They don't produce a complete HTML page, but only pieces of data that are inserted one after the other into the HTML DOM of the calling page. The special query string item ```target``` should be added to the script URL in this case.
@@ -121,6 +122,7 @@ Compiled and tested successfully using:
121
122
122
123
**Note for Windows developers:** All data-only scripts should have ```$|=1;``` among their first lines to disable the built-in buffering of the Perl interpreter. Some Windows builds of Perl may not give any output until the script is finished when buffering is enabled.
123
124
125
+
<aname="feeding-from-forms"></a>
124
126
There is no special naming convention for long running scripts. They can be called from hyperlinks or HTML forms using a full HTTP URL with the PEB pseudo-domain or a relative path. If a relative path is used, the PEB pseudo-domain will be added automatically. The following code is an example of a direct POST request to a local script from an HTML form:
125
127
126
128
```html
@@ -176,7 +178,8 @@ PEB is designed to run from any directory without setting anything beforehand an
176
178
***Start page:**
177
179
PEB can start with a static HTML start page or with a start page that is produced dynamically by a Perl script. When PEB is started, it will first try to find ```{PEB_binary_directory}/resources/app/index.html```. If this file is found, it will be used as a start page. If this file is missing, PEB will try to find ```{PEB_binary_directory}/resources/app/index.pl```. If this script is found, it will be executed and the resulting HTML output will be displayed as a start page. If both ```index.html``` and ```index.pl``` are not found, an error message will be displayed. No start page is a showstopper for PEB.
178
180
Note that both static and dynamic start page pathnames are case sensitive.
179
-
***Icon:**
181
+
***Icon:**
182
+
<aname="icon"></a>
180
183
A PEB-based application can have its own icon and it must be located at ```{PEB_binary_directory}/resources/app/app.png```. If this file is found during application startup, it will be used as the icon of all windows and dialog boxes. If this file is not found, the default icon embedded into the resources of the browser binary will be used.
181
184
***Trusted domains:**
182
185
If PEB is able to read ```{PEB_binary_directory}/resources/app/trusted-domains.json```, all domains listed in this file are considered trusted. Only the local pseudo-domain ```http://local-pseudodomain/``` is trusted if ```trusted-domains.json``` is missing. This setting should be used with care - see section [Security](#security).
@@ -187,7 +190,8 @@ PEB is designed to run from any directory without setting anything beforehand an
187
190
They have two functions:
188
191
**1.** to facilitate the development of fully translated and multilanguage applications by providing labels for the context menu and JavaScript dialog boxes with no dependency on compiled Qt translation files and
189
192
**2.** to prevent data loss when user tries to close a local page containing unsaved data in an HTML form.
Using the following code any local HTML page can have custom labels on the default right-click context menu (if the ```contextmenu``` event is not already intercepted):
192
196
193
197
```javascript
@@ -206,8 +210,9 @@ They have two functions:
206
210
}
207
211
```
208
212
209
-
***Custom or translated labels for JavaScript dialog boxes:**
210
-
Using the following code any local HTML page can have custom labels on the default JavaScript Alert, Confirm and Prompt dialog boxes:
213
+
***Custom or translated labels for JavaScript dialog boxes:**
Using the following code any local HTML page can have custom labels on the default JavaScript *Alert*, *Confirm* and *Prompt* dialog boxes:
211
216
212
217
```javascript
213
218
functionpebMessageBoxElements() {
@@ -295,9 +300,6 @@ They have two functions:
295
300
The pseudo-domain is used to call all local files and all special URLs representing browser functions.
296
301
It is intercepted inside PEB and is not passed to the underlying operating system.
297
302
298
-
***Close current window:**```http://local-pseudodomain/close-window.function```
299
-
Please note that the window from where this URL was called will be closed immediately without any check for unsaved user data in HTML forms. Window-closing URL was implememented to make possible asynchronous window close confirmation JavaScript routines - see section *Settings*, paragraph [Checking for unsaved user input before closing a window](#checking-for-unsaved-user-input-before-closing-a-window).
300
-
301
303
***Select single file:**```http://local-pseudodomain/open-file.function?target=DOM_element```
302
304
<aname="select-single-file"></a>
303
305
The full path of the selected file will be inserted in the target DOM element of the calling local page.
***Close current window:**```http://local-pseudodomain/close-window.function```
366
+
Please note that the window from where this URL was called will be closed immediately without any check for unsaved user data in HTML forms. Window-closing URL was implememented to make possible asynchronous window close confirmation JavaScript routines - see section *Settings*, paragraph [Checking for unsaved user input before closing a window](#checking-for-unsaved-user-input-before-closing-a-window).
362
367
363
368
## HTML Interface for the Perl Debugger
364
369
Any Perl script can be selected for debugging in an embedded HTML user interface. The debugger output is displayed together with the syntax highlighted source code of the debugged script and its modules. Syntax highlighting is achieved using [Syntax::Highlight::Engine::Kate](https://metacpan.org/release/Syntax-Highlight-Engine-Kate) CPAN module by Hans Jeuken and Gábor Szabó. Interaction with the built-in Perl debugger is an idea proposed by Valcho Nedelchev and provoked by the scarcity of graphical frontends for the Perl debugger.
0 commit comments