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 = {
889
889
}
890
890
891
891
// 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 ) {
893
899
// TODO: remove onpopstate handler on uninstall()
894
900
var oldOnPopState = window . onpopstate ;
895
901
window . onpopstate = function ( ) {
You can’t perform that action at this time.
0 commit comments