File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -889,7 +889,13 @@ Raven.prototype = {
889889 }
890890
891891 // record navigation (URL) changes
892- if ( 'history' in window && history . pushState ) {
892+ // NOTE: in Chrome App environment, touching history.pushState, *even inside
893+ // a try/catch block*, will cause Chrome to output an error to console.error
894+ // borrowed from: https://github.com/angular/angular.js/pull/13945/files
895+ var chrome = window . chrome ;
896+ var isChromePackagedApp = chrome && chrome . app && chrome . app . runtime ;
897+ var hasPushState = ! isChromePackagedApp && window . history && history . pushState ;
898+ if ( hasPushState ) {
893899 // TODO: remove onpopstate handler on uninstall()
894900 var oldOnPopState = window . onpopstate ;
895901 window . onpopstate = function ( ) {
You can’t perform that action at this time.
0 commit comments