Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Systrace Error. Uncaught SecurityError: Failed to execute 'pushState' on 'History'

I am trying to open the HTML file generated by systrace. When I click on one the block I used to get the selected slice information like "Duration", "Total Time" etc. But with the latest version of chrome that is not working.

Tried on latest chrome(ver.45), chrome beta(ver.46) and chrome Dev(ver.47) version and I see the same problem across all the versions.

I see that when I click on the slice, instead of showing the details, it throws error stating

Uncaught SecurityError: Failed to execute 'pushState' on 'History': A history state object with URL 'file:///C:/Users/ssundark/Desktop/vsync_off_default_sclk.html' cannot be created in a document with origin 'null'.

Can someone please let me any work around to this problem ? or if there is some way we can open this file to know the selected slice information.

like image 601
Shyam Sundar Kulkarni Avatar asked Sep 10 '15 17:09

Shyam Sundar Kulkarni


2 Answers

I was able to fix it following the directions here: https://stackoverflow.com/a/13262673/1292598

Long story short: Start Chrome with the --allow-file-access-from-files flag.

like image 70
Tom Mulcahy Avatar answered Oct 04 '22 10:10

Tom Mulcahy


The problem is that window.history.pushState throws an error when window.history.state is null or undefined.

To fix this problem, just do:

if (window.history.state) {
   window.history.pushState(state, title, href);
}
like image 25
Vinicius José Latorre Avatar answered Oct 04 '22 08:10

Vinicius José Latorre