Skip to content

Commit dc42f9e

Browse files
committed
shorter pseudo-domain
1 parent 3eeb055 commit dc42f9e

File tree

14 files changed

+75
-75
lines changed

14 files changed

+75
-75
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Compiled and tested successfully using:
9999
$(document).ready(function() {
100100
$('#ajax-button').click(function() {
101101
$.ajax({
102-
url: 'http://perl-executing-browser-pseudodomain/perl/ajax-test.pl',
102+
url: 'http://local-pseudodomain/perl/ajax-test.pl',
103103
method: 'GET',
104104
dataType: 'text',
105105
success: function(data) {
@@ -191,7 +191,7 @@ JavaScript-based settings are created to facilitate the development of fully tra
191191

192192
The synchronous warning function is implemented using standard JavaScript Confirm dialog, which stops the execution of all JavaScript code within the page and waits until 'Yes' or 'No' is finally pressed. The Confirm dialog looks like a normal native dialog.
193193

194-
The asynchronous warning function is implemented using JavaScript, HTML and CSS code, does not stop the execution of any JavaScript code within the page and does not wait for the user's decision. If the user chooses to close the window, a special window closing URL, ```http://perl-executing-browser-pseudodomain/close-window.function```, has to be sent to the browser. Upon receiving this URL, PEB closes the window from where the window closing URL was requested. The warning dialog can be styled to blend with the rest of the HTML interface or to attract attention and this is the main advantage of using an asynchronous warning dialog. Developers can implement it using any suitable JavaScript library or custom code.
194+
The asynchronous warning function is implemented using JavaScript, HTML and CSS code, does not stop the execution of any JavaScript code within the page and does not wait for the user's decision. If the user chooses to close the window, a special window closing URL, ```http://local-pseudodomain/close-window.function```, has to be sent to the browser. Upon receiving this URL, PEB closes the window from where the window closing URL was requested. The warning dialog can be styled to blend with the rest of the HTML interface or to attract attention and this is the main advantage of using an asynchronous warning dialog. Developers can implement it using any suitable JavaScript library or custom code.
195195

196196
The following code is an example of both synchronous and asynchronous warning functions. It is expected, that one of them will be present in a PEB-based application where user data is to be protected against accidental loss. If both functions are present, the asynchronous one will take precedence. The asynchronous function in the example code is implemented using [jQuery] (https://jquery.com/) and [Alertify.js] (http://alertifyjs.com/).
197197

@@ -207,7 +207,7 @@ JavaScript-based settings are created to facilitate the development of fully tra
207207
alertify.confirm("Are you sure you want to close the window?", function (confirmation) {
208208
if (confirmation) {
209209
$jQuery.ajax({
210-
url: 'http://perl-executing-browser-pseudodomain/close-window.function',
210+
url: 'http://local-pseudodomain/close-window.function',
211211
method: 'GET'
212212
});
213213
}
@@ -217,11 +217,11 @@ JavaScript-based settings are created to facilitate the development of fully tra
217217

218218

219219
## Security
220-
Being a GUI for Perl 5 desktop applications, PEB executes only Perl scripts distributed with the browser binary and they are treated as ordinary desktop programs with normal user privileges. Reasonable security restrictions are implemented in both C++ and Perl code, but they do not constitute a sandbox for Perl scripts. PEB users can not endanger the opreating system or fall victims to remote or arbitrary Perl code, but they still have full access to their own local data.
220+
Being a GUI for Perl 5 desktop applications, PEB executes with normal user privileges only local Perl scripts in it's application directory. Reasonable security restrictions are implemented in both C++ and Perl code, but they do not constitute a sandbox for Perl scripts. PEB users can not endanger the opreating system or fall victims to remote Perl code, but they still have full access to their own local data.
221221

222222
**Security features based on C++ code:**
223223
* PEB can not and does not download remote files on hard disk and can not execute any Perl scripts from remote locations.
224-
* 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/```.
224+
* 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://local-pseudodomain/```.
225225
* If PEB is started with administrative privileges, it displays a warning page and no scripts can be executed.
226226
* 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.
227227

@@ -236,14 +236,14 @@ JavaScript-based settings are created to facilitate the development of fully tra
236236

237237
## Special URLs for Users and Interaction with Files and Folders
238238

239-
* **PEB pseudo-domain:** ```http://perl-executing-browser-pseudodomain/```
239+
* **PEB pseudo-domain:** ```http://local-pseudodomain/```
240240
The pseudo-domain is used to call all local files and all special URLs representing browser functions.
241241
It is intercepted inside PEB and is not passed to the underlying operating system.
242242

243-
* **Close current window:** ```http://perl-executing-browser-pseudodomain/close-window.function```
243+
* **Close current window:** ```http://local-pseudodomain/close-window.function```
244244
Please note that using this URL 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 can be called not only by clicking a link, but also by using a jQuery AJAX GET request.
245245

246-
* **Select single file:** ```http://perl-executing-browser-pseudodomain/open-file.function?target=DOM_element```
246+
* **Select single file:** ```http://local-pseudodomain/open-file.function?target=DOM_element```
247247
The full path of the selected file will be inserted in the target DOM element of the calling local page.
248248
Having a target DOM element is mandatory when using this special URL.
249249
HTML event called ```inodeselection``` is emitted when the path of the selected file is inserted into the calling local page.
@@ -258,7 +258,7 @@ JavaScript-based settings are created to facilitate the development of fully tra
258258
$(document).ready(function() {
259259
$('#file-selection').bind("inodeselection", function(){
260260
$.ajax({
261-
url: 'http://perl-executing-browser-pseudodomain/perl/open-file.pl',
261+
url: 'http://local-pseudodomain/perl/open-file.pl',
262262
data: {filename: $('#file-selection').html()},
263263
method: 'POST',
264264
dataType: 'text',
@@ -270,34 +270,34 @@ JavaScript-based settings are created to facilitate the development of fully tra
270270
});
271271
```
272272

273-
* **Select multiple files:** ```http://perl-executing-browser-pseudodomain/open-files.function?target=DOM_element```
273+
* **Select multiple files:** ```http://local-pseudodomain/open-files.function?target=DOM_element```
274274
The full paths of the selected files will be inserted in the target DOM element of the calling local page.
275275
Having a target DOM element is mandatory when using this special URL.
276276
```inodeselection``` HTML event is emitted when the paths of the selected files are inserted into the calling local page.
277277
Different file names are separated by a semicolon - ```;```
278278

279-
* **Select new file name:** ```http://perl-executing-browser-pseudodomain/new-file-name.function?target=DOM_element```
279+
* **Select new file name:** ```http://local-pseudodomain/new-file-name.function?target=DOM_element```
280280
The full path of the new file name will be inserted in the target DOM element of the calling local page.
281281
Having a target DOM element is mandatory when using this special URL.
282282
```inodeselection``` HTML event is emitted when the new file name is inserted into the calling local page.
283283

284284
Please note that the actual creation of the new file is not performed directly by PEB. Only after the new file name is transmitted to a Perl script, the script itself creates the new file.
285285

286-
* **Select directory:** ```http://perl-executing-browser-pseudodomain/open-directory.function?target=DOM_element```
286+
* **Select directory:** ```http://local-pseudodomain/open-directory.function?target=DOM_element```
287287
The full path of the selected directory will be inserted in the target DOM element of the calling local page.
288288
Having a target DOM element is mandatory when using this special URL.
289289
```inodeselection``` HTML event is emitted when the path of the selected directory is inserted into the calling local page.
290290

291291
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.
292292

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

296-
* **Print Preview:** ```http://perl-executing-browser-pseudodomain/print.function?action=preview```
296+
* **Print Preview:** ```http://local-pseudodomain/print.function?action=preview```
297297

298-
* **About PEB embedded page:** ```http://perl-executing-browser-pseudodomain/about.function?type=browser```
298+
* **About PEB embedded page:** ```http://local-pseudodomain/about.function?type=browser```
299299

300-
* **About Qt dialog box:** ```http://perl-executing-browser-pseudodomain/about.function?type=qt```
300+
* **About Qt dialog box:** ```http://local-pseudodomain/about.function?type=qt```
301301

302302
## HTML Interface for the Perl Debugger
303303
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.
@@ -306,14 +306,14 @@ JavaScript-based settings are created to facilitate the development of fully tra
306306

307307
## Special URLs for Interaction with the Perl Debugger
308308

309-
* **Select file:** ```http://perl-executing-browser-pseudodomain/perl-debugger.function?action=select-file```
309+
* **Select file:** ```http://local-pseudodomain/perl-debugger.function?action=select-file```
310310
Using the above URL the selected file will be loaded in the Perl debugger, but no command will be automatically issued. Any command can be given later by buttons or by typing it in an input box inside the HTML user interface of the debugger.
311311

312-
* **Send command:** ```http://perl-executing-browser-pseudodomain/perl-debugger.function?command=M```
312+
* **Send command:** ```http://local-pseudodomain/perl-debugger.function?command=M```
313313

314314
* **Combined Perl Debugger URL:**
315315
Selecting file to debug and sending command to the Pel debugger can be combined in a single URL.
316-
Example: ```http://perl-executing-browser-pseudodomain/perl-debugger.function?action=select-file&command=M```
316+
Example: ```http://local-pseudodomain/perl-debugger.function?action=select-file&command=M```
317317
Using the above URL, the selected file will be loaded in the Perl debugger, the ```M``` command ('Display all loaded modules') will be immediately issued and all resulting output will be displayed. Any command can be given later and step-by-step debugging can be performed.
318318

319319
## Supported File Extensions for Local Content
@@ -340,8 +340,8 @@ JavaScript-based settings are created to facilitate the development of fully tra
340340

341341
* PEB is not a general purpose web browser and does not have all traditional features of general purpose web browsers.
342342
* 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.
343-
* PEB does not embed any Perl interpreter in itself and rellies on an external Perl distribution, which could be easily changed or upgraded independently.
344-
* Perl scripts executed by PEB, unlike JavaScript in general purpose web browsers, have no direct access to the HTML DOM tree of any page.
343+
* PEB does not embed any Perl interpreter in itself and rellies on an external Perl distribution, which could be easily changed or upgraded independently.
344+
Perl scripts executed by PEB, unlike JavaScript in general purpose web browsers, have no direct access to the HTML DOM tree of any page.
345345

346346
## Limitations
347347

resources/app/filesystem.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,42 @@
1010
<script type="text/javascript" src="jquery/jquery-1.11.1.min.js"></script>
1111

1212
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
13-
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" media="all"/>
14-
<link rel="stylesheet" type="text/css" href="bootstrap/css/themes/darkly-theme.css" media="all"/>
13+
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" media="all">
14+
<link rel="stylesheet" type="text/css" href="bootstrap/css/themes/darkly-theme.css" media="all">
1515

1616
<script type="text/javascript" src="peb/peb.js"></script>
1717

1818
</head>
1919

2020
<body>
2121

22-
<a href='http://perl-executing-browser-pseudodomain/open-file.function?target=file-selection' class="btn btn-info btn-primary">
22+
<a href='http://local-pseudodomain/open-file.function?target=file-selection' class="btn btn-info btn-primary">
2323
Select Single File</a>
2424
<div id="file-selection"></div>
2525

2626
<br>
2727

28-
<a href='http://perl-executing-browser-pseudodomain/open-files.function?target=files-selection' class="btn btn-info btn-primary">
28+
<a href='http://local-pseudodomain/open-files.function?target=files-selection' class="btn btn-info btn-primary">
2929
Select Multiple Files</a>
3030
<div id="files-selection"></div>
3131

3232
<br>
3333

34-
<a href='http://perl-executing-browser-pseudodomain/new-file-name.function?target=new-file-name-selection' class="btn btn-info btn-primary">
34+
<a href='http://local-pseudodomain/new-file-name.function?target=new-file-name-selection' class="btn btn-info btn-primary">
3535
Select New Filename</a>
3636
<div id="new-file-name-selection"></div>
3737

3838
<br>
3939

40-
<a href='http://perl-executing-browser-pseudodomain/open-directory.function?target=directory-selection' class="btn btn-info btn-primary">
40+
<a href='http://local-pseudodomain/open-directory.function?target=directory-selection' class="btn btn-info btn-primary">
4141
Select Directory</a>
4242
<div id="directory-selection"></div>
4343

4444
<script>
4545
$(document).ready(function() {
4646
$('#file-selection').bind("inodeselection", function(){
4747
$.ajax({
48-
url: 'http://perl-executing-browser-pseudodomain/perl/open-file.pl',
48+
url: 'http://local-pseudodomain/perl/open-file.pl',
4949
data: {filename: $('#file-selection').html()},
5050
method: 'POST',
5151
dataType: 'text',
@@ -62,7 +62,7 @@
6262

6363
$('#directory-selection').bind("inodeselection", function(){
6464
$.ajax({
65-
url: 'http://perl-executing-browser-pseudodomain/perl/open-directory.pl',
65+
url: 'http://local-pseudodomain/perl/open-directory.pl',
6666
data: {directoryname: $('#directory-selection').html()},
6767
method: 'POST',
6868
dataType: 'text',

resources/app/get.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<script type="text/javascript" src="jquery/jquery-1.11.1.min.js"></script>
1111

1212
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
13-
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" media="all"/>
14-
<link rel="stylesheet" type="text/css" href="bootstrap/css/themes/darkly-theme.css" media="all"/>
13+
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" media="all">
14+
<link rel="stylesheet" type="text/css" href="bootstrap/css/themes/darkly-theme.css" media="all">
1515

1616
<script type="text/javascript" src="peb/peb.js"></script>
1717

resources/app/index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<script type="text/javascript" src="jquery/jquery-1.11.1.min.js"></script>
1111

1212
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
13-
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" media="all"/>
14-
<link rel="stylesheet" type="text/css" href="bootstrap/css/themes/darkly-theme.css" media="all"/>
13+
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" media="all">
14+
<link rel="stylesheet" type="text/css" href="bootstrap/css/themes/darkly-theme.css" media="all">
1515
<script type="text/javascript" src="bootstrap/js/bootstrap-dropdown.js"></script>
1616

1717
<style>
@@ -42,10 +42,10 @@
4242
Perl Debugger GUI<span class="caret"></span>
4343
</a>
4444
<ul class="dropdown-menu" role="menu" aria-labelledby="requests">
45-
<li><a href="http://perl-executing-browser-pseudodomain/perl-debugger.function?action=select-file&command=M" target="iframe_a">List All Modules</a></li>
46-
<li><a href="http://perl-executing-browser-pseudodomain/perl-debugger.function?action=select-file&command=S" target="iframe_a">List All Subroutine Names</a></li>
47-
<li><a href="http://perl-executing-browser-pseudodomain/perl-debugger.function?action=select-file&command=V" target="iframe_a">List All Variables</a></li>
48-
<li><a href="http://perl-executing-browser-pseudodomain/perl-debugger.function?action=select-file&command=s" target="iframe_a">Step-by-Step Debugging</a></li>
45+
<li><a href="http://local-pseudodomain/perl-debugger.function?action=select-file&command=M" target="iframe_a">List All Modules</a></li>
46+
<li><a href="http://local-pseudodomain/perl-debugger.function?action=select-file&command=S" target="iframe_a">List All Subroutine Names</a></li>
47+
<li><a href="http://local-pseudodomain/perl-debugger.function?action=select-file&command=V" target="iframe_a">List All Variables</a></li>
48+
<li><a href="http://local-pseudodomain/perl-debugger.function?action=select-file&command=s" target="iframe_a">Step-by-Step Debugging</a></li>
4949
</ul>
5050
</li>
5151

@@ -54,8 +54,8 @@
5454
Printing<span class="caret"></span>
5555
</a>
5656
<ul class="dropdown-menu" role="menu" aria-labelledby="requests">
57-
<li><a href="http://perl-executing-browser-pseudodomain/print.function?action=preview" target="iframe_a">Print Preview</a></li>
58-
<li><a href="http://perl-executing-browser-pseudodomain/print.function?action=print" target="iframe_a">Print</a></li>
57+
<li><a href="http://local-pseudodomain/print.function?action=preview" target="iframe_a">Print Preview</a></li>
58+
<li><a href="http://local-pseudodomain/print.function?action=print" target="iframe_a">Print</a></li>
5959
</ul>
6060
</li>
6161

@@ -68,13 +68,13 @@
6868
About<span class="caret"></span>
6969
</a>
7070
<ul class="dropdown-menu" role="menu" aria-labelledby="requests">
71-
<li><a href="http://perl-executing-browser-pseudodomain/about.function?type=browser" target="iframe_a">About PEB</a></li>
72-
<li><a href="http://perl-executing-browser-pseudodomain/about.function?type=qt" target="iframe_a">About Qt</a></li>
71+
<li><a href="http://local-pseudodomain/about.function?type=browser" target="iframe_a">About PEB</a></li>
72+
<li><a href="http://local-pseudodomain/about.function?type=qt" target="iframe_a">About Qt</a></li>
7373
</ul>
7474
</li>
7575

7676
<li>
77-
<a href="http://perl-executing-browser-pseudodomain/close-window.function">Close window</a>
77+
<a href="http://local-pseudodomain/close-window.function">Close window</a>
7878
</li>
7979

8080
</ul>

0 commit comments

Comments
 (0)