Skip to content

Commit

Permalink
remove unsafe eval that b break CSP #647
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 24, 2021
1 parent 9c28d59 commit 0ced768
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 38 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.22.1
### Bugfix
* remove unsafe eval (function constructor) that b break CSP []()

## 2.22.0
### Features
* make unix formatting and basic tools work in web worker
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
__ / / // / // / _ / _/ // / / / _ / _/ / / \/ / _ \/ /
/ / / // / // / ___/ // // / / / ___/ // / / / / /\ / // / /__
\___/____ \\__/____/_/ \__ / /_/____/_//_/_/_/_/_/ \/\__\_\___/
\/ /____/ version 2.22.0
\/ /____/ version DEV
```
https://terminal.jcubic.pl

[![npm](https://img.shields.io/badge/npm-2.22.0-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-2.22.0-yellow.svg)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=master&9fb3dcfddd2a4d346dc8cffbc4089553c068b292)](https://travis-ci.org/jcubic/jquery.terminal)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=master&634dd6bdb563cac4da5f3e6ae04ce222)](https://coveralls.io/github/jcubic/jquery.terminal?branch=master)
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&9c28d597e8295a5bd282030256a9fe1b50a371c1)](https://travis-ci.org/jcubic/jquery.terminal)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&634dd6bdb563cac4da5f3e6ae04ce222)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
![downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
[![](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded)](https://www.jsdelivr.com/package/npm/jquery.terminal)
[![LICENSE MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jcubic/jquery.terminal/blob/master/LICENSE)
Expand Down Expand Up @@ -78,20 +78,20 @@ Include jQuery library, you can use cdn from https://jquery.com/download/
```


Then include js/jquery.terminal-2.22.0.min.js and css/jquery.terminal-2.22.0.min.css
Then include js/jquery.terminal-DEV.min.js and css/jquery.terminal-DEV.min.css

You can grab the files from CDN:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.22.0/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.22.0/css/jquery.terminal.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/css/jquery.terminal.min.css" rel="stylesheet"/>
```

or

```html
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.22.0/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.22.0/css/jquery.terminal.min.css">
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/css/jquery.terminal.min.css">
```

If you always want latest version, you can get it from [unpkg](https://unpkg.com/) without specifying version,
Expand Down
2 changes: 1 addition & 1 deletion css/emoji.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions css/jquery.terminal-2.22.0.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.22.0
* \/ /____/ version DEV
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2021 Jakub Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Sun, 14 Feb 2021 11:03:09 +0000
* Date: Wed, 24 Feb 2021 14:00:20 +0000
*/

.terminal .terminal-output .format, .cmd .format,
Expand Down
4 changes: 2 additions & 2 deletions css/jquery.terminal-2.22.0.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions css/jquery.terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.22.0
* \/ /____/ version DEV
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2021 Jakub Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license
*
* Date: Sun, 14 Feb 2021 11:03:09 +0000
* Date: Wed, 24 Feb 2021 14:00:20 +0000
*/

.terminal .terminal-output .format, .cmd .format,
Expand Down
4 changes: 2 additions & 2 deletions css/jquery.terminal.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/jquery.terminal.min.css.map

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions js/jquery.terminal-2.22.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.22.0
* \/ /____/ version DEV
*
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
*
Expand Down Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 14 Feb 2021 11:03:09 +0000
* Date: Wed, 24 Feb 2021 14:00:19 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -1212,7 +1212,13 @@
return !!get.toString().match(/\[native code\]/);
})();
// -------------------------------------------------------------------------
var is_browser = new Function('try {return this===window;}catch(e){return false;}')();
var is_browser = (function() {
try {
return this === window;
} catch (e) {
return false;
}
})();
// -------------------------------------------------------------------------
var is_mobile = (function(a) {
var check = false;
Expand Down Expand Up @@ -4761,8 +4767,8 @@
}
// -------------------------------------------------------------------------
$.terminal = {
version: '2.22.0',
date: 'Sun, 14 Feb 2021 11:03:09 +0000',
version: 'DEV',
date: 'Wed, 24 Feb 2021 14:00:19 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal-2.22.0.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,13 @@
return !!get.toString().match(/\[native code\]/);
})();
// -------------------------------------------------------------------------
var is_browser = new Function('try {return this===window;}catch(e){return false;}')();
var is_browser = (function() {
try {
return this === window;
} catch (e) {
return false;
}
})();
// -------------------------------------------------------------------------
var is_mobile = (function(a) {
var check = false;
Expand Down
16 changes: 11 additions & 5 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.22.0
* \/ /____/ version DEV
*
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
*
Expand Down Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 14 Feb 2021 11:03:09 +0000
* Date: Wed, 24 Feb 2021 14:00:19 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -1212,7 +1212,13 @@
return !!get.toString().match(/\[native code\]/);
})();
// -------------------------------------------------------------------------
var is_browser = new Function('try {return this===window;}catch(e){return false;}')();
var is_browser = (function() {
try {
return this === window;
} catch (e) {
return false;
}
})();
// -------------------------------------------------------------------------
var is_mobile = (function(a) {
var check = false;
Expand Down Expand Up @@ -4761,8 +4767,8 @@
}
// -------------------------------------------------------------------------
$.terminal = {
version: '2.22.0',
date: 'Sun, 14 Feb 2021 11:03:09 +0000',
version: 'DEV',
date: 'Wed, 24 Feb 2021 14:00:19 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 0ced768

Please sign in to comment.