Skip to content

Commit 69cf82e

Browse files
HeroProtagonistkamilogorek
authored andcommitted
Check for replaceState and fill it
1 parent 30e64a9 commit 69cf82e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/raven.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,8 +1272,12 @@ Raven.prototype = {
12721272
// borrowed from: https://github.com/angular/angular.js/pull/13945/files
12731273
var chrome = _window.chrome;
12741274
var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
1275-
var hasPushState = !isChromePackagedApp && _window.history && history.pushState;
1276-
if (autoBreadcrumbs.location && hasPushState) {
1275+
var hasPushAndReplaceState =
1276+
!isChromePackagedApp &&
1277+
_window.history &&
1278+
history.pushState &&
1279+
history.replaceState;
1280+
if (autoBreadcrumbs.location && hasPushAndReplaceState) {
12771281
// TODO: remove onpopstate handler on uninstall()
12781282
var oldOnPopState = _window.onpopstate;
12791283
_window.onpopstate = function() {
@@ -1302,6 +1306,7 @@ Raven.prototype = {
13021306
};
13031307

13041308
fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
1309+
fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
13051310
}
13061311

13071312
if (autoBreadcrumbs.console && 'console' in _window && console.log) {

0 commit comments

Comments
 (0)