Skip to content

Commit 3106d81

Browse files
committed
documentation update
1 parent ed098b8 commit 3106d81

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed

README.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Inspired by [NW.js] (http://nwjs.io/) and [Electron] (http://electron.atom.io/),
3030
* Basic security restrictions are imposed on every Perl script.
3131
* PEB can be started from any folder.
3232
* PEB is usefull for both single-page or multi-page applications.
33-
* Single file or multiple files, new filename, existing or new directory can be selected by user.
33+
* Single file or multiple files, new filename, existing or new directory can be selected by user.
3434
Their full paths are displayed in the calling local page and they can be supplied to local Perl scripts.
3535
* Browser functions are accessible from special URLs.
3636
* Any icon can be displayed on windows and message boxes.
@@ -65,7 +65,9 @@ Compiled and tested successfully using:
6565

6666
* Qt 5 libraries,
6767
* Perl 5 distribution - any Linux, Mac or Windows Perl distribution.
68-
[Strawberry Perl] (http://strawberryperl.com/) PortableZIP edition is successfully used with all Windows builds of PEB.
68+
[Strawberry Perl] (http://strawberryperl.com/) PortableZIP edition is successfully used with all Windows builds of PEB.
69+
[Perlbrew] (https://perlbrew.pl/) Perl distributions (5.18.4, 5.23.7) are successfully used with many Linux builds of PEB.
70+
Being unable to start with administrative privileges PEB can use, but not abuse, any system Perl on PATH.
6971

7072
## How to Call Local Perl Scripts from a Local Page?
7173
PEB recognizes two types of local Perl scripts: non-AJAX scripts and AJAX scripts.
@@ -216,6 +218,21 @@ JavaScript-based settings are created to facilitate the development of fully tra
216218
```
217219

218220

221+
## Security
222+
223+
**Security features based on C++ code:**
224+
* PEB can not and does not download remote files on hard disk and can not execute any Perl scripts from remote locations.
225+
* Users have no dialog to select arbitrary local scripts for execution by PEB. Only scripts within the ```{PEB_binary_directory}/resources/app``` directory can be executed if they are invoked from the PEB pseudo-domain: ```http://perl-executing-browser-pseudodomain/```.
226+
* Starting PEB with administrative privileges is not allowed - it exits with a warning message.
227+
* Perl 5 scripts are executed in a clean environment and only ```REQUEST_METHOD```, ```QUERY_STRING``` and ```CONTENT_LENGTH``` environment variables (borrowed from the CGI protocol) are used for communication between local HTML forms and local Perl scripts.
228+
229+
**Security features based on Perl code:**
230+
* Perl scripts are executed in an ```eval``` function after banning potentially unsafe core functions. This feature is implemented in a special script named ```censor.pl```, which is compiled into the resources of the browser binary and is executed from memory when Perl script is started. All core functions from the :dangerous group - ```syscall```, ```dump``` and ```chroot```, as well as ```fork``` are banned. ```fork``` is banned to avoid any orphan processes, which may be created if this function is carelessly used.
231+
* The environment of all Perl scripts is once again filtered in the ```BEGIN``` block of ```censor.pl``` to ensure no unwanted environment variables are inserted by the operating system.
232+
233+
**Perl Debugger Interaction:**
234+
* Any Perl script can be selected for debugging, which is also a security risk. So if Perl debugger interaction is not needed, it can be turned off by a compile-time variable. Just change ```PERL_DEBUGGER_INTERACTION = 1``` to ```PERL_DEBUGGER_INTERACTION = 0``` in the project file of the browser (peb.pro) and compile the binary.
235+
219236
## Special URLs for Users and Interaction with Files and Folders
220237

221238
* **PEB pseudo-domain:** ```http://perl-executing-browser-pseudodomain/```
@@ -258,7 +275,7 @@ JavaScript-based settings are created to facilitate the development of fully tra
258275
```inodeselection``` HTML event is emitted when the paths of the selected files are inserted into the calling local page.
259276
Different file names are separated by a semicolon - ```;```
260277

261-
* **Select new file name:** ```http://perl-executing-browser-pseudodomain/new-file.function?target=DOM_element```
278+
* **Select new file name:** ```http://perl-executing-browser-pseudodomain/new-file-name.function?target=DOM_element```
262279
The full path of the new file name will be inserted in the target DOM element of the calling local page.
263280
Having a target DOM element is mandatory when using this special URL.
264281
```inodeselection``` HTML event is emitted when the new file name is inserted into the calling local page.
@@ -272,13 +289,14 @@ JavaScript-based settings are created to facilitate the development of fully tra
272289

273290
Please note that if you choose to create a new directory, it will be created immediately by PEB and it will be already existing when it will be passed to a local Perl script.
274291

275-
* **Print:** ```http://perl-executing-browser-pseudodomain/?action=preview```
292+
* **Print:** ```http://perl-executing-browser-pseudodomain/print.function?action=print```
293+
Printing is not immediately performed, but a native printer selection dialog is displayed first.
276294

277-
* **Print Preview:** ```http://perl-executing-browser-pseudodomain/?action=print```
295+
* **Print Preview:** ```http://perl-executing-browser-pseudodomain/print.function?action=preview```
278296

279-
* **About PEB embedded page:** ```http://perl-executing-browser-pseudodomain/?type=browser```
297+
* **About PEB embedded page:** ```http://perl-executing-browser-pseudodomain/about.function?type=browser```
280298

281-
* **About Qt dialog box:** ```http://perl-executing-browser-pseudodomain/?type=browser```
299+
* **About Qt dialog box:** ```http://perl-executing-browser-pseudodomain/about.function?type=qt```
282300

283301
## HTML Interface for the Perl Debugger
284302
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 it's 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.
@@ -317,36 +335,22 @@ JavaScript-based settings are created to facilitate the development of fully tra
317335
* ```Ctrl+P``` - Print
318336
* ```Ctrl+I``` - debug current page using ```QWebInspector```
319337

320-
## Security
321-
322-
**Security features based on C++ code:**
323-
* PEB can not and does not download remote files on hard disk and can not execute any Perl scripts from remote locations.
324-
* Users have no dialog to select arbitrary local scripts for execution by PEB. Only scripts within the ```{PEB_binary_directory}/resources/app``` directory can be executed if they are invoked from the PEB pseudo-domain: ```http://perl-executing-browser-pseudodomain/```.
325-
* Starting PEB with administrative privileges is not allowed - it exits with a warning message.
326-
* Perl 5 scripts are executed in a clean environment and only ```REQUEST_METHOD```, ```QUERY_STRING``` and ```CONTENT_LENGTH``` environment variables (borrowed from the CGI protocol) are used for communication between local HTML forms and local Perl scripts.
327-
328-
**Security features based on Perl code:**
329-
* Perl scripts are executed in an ```eval``` function after banning potentially unsafe core functions. This feature is implemented in a special script named ```censor.pl```, which is compiled into the resources of the browser binary and is executed from memory when Perl script is started. All core functions from the :dangerous group - ```syscall```, ```dump``` and ```chroot```, as well as ```fork``` are banned.
330-
* The environment of all Perl scripts is once again filtered in the ```BEGIN``` block of ```censor.pl``` to ensure no unwanted environment variables are inserted by the operating system.
331-
332-
**Perl Debugger Interaction:**
333-
* Any Perl script can be selected for debugging, which is also a security risk. So if Perl debugger interaction is not needed, it can be turned off by a compile-time variable. Just change ```PERL_DEBUGGER_INTERACTION = 1``` to ```PERL_DEBUGGER_INTERACTION = 0``` in the project file of the browser (peb.pro) and compile the binary.
334-
335-
## Limitations
336-
337-
* No history and cache. JavaScript functions ```window.history.back()```, ```window.history.forward()``` and ```window.history.go()``` are disabled.
338-
* No reloading from JavaScript of a page that is produced by local script, but local static pages, as well as web pages, can be reloaded from JavaScript using ```location.reload()```.
339-
* No file can be downloaded on hard disk.
340-
* No support for plugins and HTML 5 video.
341-
342338
## What Perl Executing Browser Is Not
343339

344340
* PEB is not a general purpose web browser and does not have all traditional features of general purpose web browsers.
345-
* Unlike JavaScript in general purpose web browsers, Perl scripts executed by PEB have no access to the HTML DOM tree of any page.
341+
* Unlike JavaScript in general purpose web browsers, Perl scripts executed by PEB have no direct access to the HTML DOM tree of any page.
346342
* PEB is not an implementation of the CGI protocol. It uses only three environment variables together with the GET and POST methods from the CGI protocol in a purely local context without any attempt to communicate with the outside world.
347343
* PEB does not embed any Perl interpreter in itself and rellies on an external Perl distribution, which could be easily changed or upgraded independently.
348344
* PEB has no sandbox for Perl scripts - they are treated like and executed as ordinary desktop applications with normal user privileges.
349345

346+
## Limitations
347+
348+
* No history and cache.
349+
JavaScript functions ```window.history.back()```, ```window.history.forward()``` and ```window.history.go()``` are disabled.
350+
* No reloading from JavaScript of a page that is produced by a local Perl script, but local static pages, as well as web pages, can be reloaded using JavaScript ```location.reload()```.
351+
* No file can be downloaded on hard disk.
352+
* No support for plugins and HTML 5 video.
353+
350354
## Target Audience
351355

352356
* Perl enthusiasts creating custom data-driven desktop applications

0 commit comments

Comments
 (0)