Skip to content

Commit

Permalink
optimized for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Concedo authored and Concedo committed Nov 27, 2023
1 parent 07a5983 commit 35451fe
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@
{
width: 100%;
resize: none;
overflow-y:scroll;
/* overflow-y:scroll; */
overflow-x:hidden;
background: #00000000 none repeat scroll 0 0;
border: medium none;
Expand Down Expand Up @@ -9712,13 +9712,14 @@
);


//strip chunks
gametext_elem.innerHTML = gametext_elem.innerHTML.replace(/<span class="(.+?)">(.+?)<\/span>/g, "$2");
gametext_elem.innerHTML = gametext_elem.innerHTML.replace(/<span class="(.+?)">(.+?)<\/span>/g, "$2");
gametext_elem.innerHTML = replaceAll(gametext_elem.innerHTML,"<div><br><br><br></div>", "<br><br><br>");
gametext_elem.innerHTML = replaceAll(gametext_elem.innerHTML,"<div><br><br></div>", "<br><br>");
gametext_elem.innerHTML = replaceAll(gametext_elem.innerHTML,"<div><br></div>", "<br>");

//strip chunks (optimize for firefox by not constantly modifying dom)
let htmlstr = gametext_elem.innerHTML;
htmlstr = htmlstr.replace(/<span class="(.+?)">(.+?)<\/span>/g, "$2");
htmlstr = htmlstr.replace(/<span class="(.+?)">(.+?)<\/span>/g, "$2");
htmlstr = replaceAll(htmlstr,"<div><br><br><br></div>", "<br><br><br>");
htmlstr = replaceAll(htmlstr,"<div><br><br></div>", "<br><br>");
htmlstr = replaceAll(htmlstr,"<div><br></div>", "<br>");
gametext_elem.innerHTML = htmlstr;

//rather than dump it all into one history, let's split it into paragraphs
let fullmergedstory = gametext_elem.innerText;
Expand Down

0 comments on commit 35451fe

Please sign in to comment.