Skip to content

Commit 9696a2f

Browse files
committed
prevent saving to browser history
1 parent a3936dc commit 9696a2f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SharedProject/Core/ReportGenerator/ReportGeneratorUtil.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ public string ProcessUnifiedHtml(string htmlForProcessing, string reportOutputFo
927927
928928
var outerHtml = doc.DocumentNode.OuterHtml;
929929
var htmlSb = new StringBuilder(outerHtml);
930+
PreventBrowserHistory(htmlSb);
930931
931932
var assembliesSearch = "var assemblies = [";
932933
var startIndex = outerHtml.IndexOf(assembliesSearch) + assembliesSearch.Length - 1;
@@ -1547,6 +1548,12 @@ Risk Hotspots
15471548
});
15481549
}
15491550

1551+
private void PreventBrowserHistory(StringBuilder documentStringBuilder)
1552+
{
1553+
documentStringBuilder.Replace(
1554+
@"{key:""onDonBeforeUnlodad"",value:function(){if(this.saveCollapseState(),void 0!==this.window.history&&void 0!==this.window.history.replaceState){console.log(""Coverage info: Updating history"",this.settings);var e=null;(e=null!==window.history.state?JSON.parse(JSON.stringify(this.window.history.state)):new Gc).coverageInfoSettings=JSON.parse(JSON.stringify(this.settings)),window.history.replaceState(e,null)}}},",
1555+
@"{key:""onDonBeforeUnlodad"",value: function(){}},");
1556+
}
15501557
private void HideRowsFromOverviewTable(HtmlDocument doc)
15511558
{
15521559
var table = doc.DocumentNode.QuerySelectorAll("table.overview").First();

0 commit comments

Comments
 (0)