File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 4
4
function fillText ( message ) {
5
5
document . querySelector ( "title" ) . textContent = message . title ;
6
6
const textNode = document . querySelector ( ".text" ) ;
7
- textNode . textContent = message . text ;
8
- textNode . innerHTML = textNode . innerHTML . replace ( / \n / g, "<br>" ) ;
7
+ let first = true ;
8
+ message . text . split ( / \n / g) . forEach ( function ( line ) {
9
+ if ( ! first ) {
10
+ textNode . appendChild ( document . createElement ( "br" ) ) ;
11
+ }
12
+ first = false ;
13
+ textNode . appendChild ( document . createTextNode ( line ) ) ;
14
+ } ) ;
9
15
document . getElementById ( "ok" ) . textContent = browser . i18n . getMessage ( "modal.message.ok" ) ;
10
16
}
11
17
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ changes:
10
10
- update client.js to version 1.9.1
11
11
12
12
fixes:
13
- -
13
+ - do not use innerHTML assignments
14
14
15
15
Version 1.7
16
16
You can’t perform that action at this time.
0 commit comments