Skip to content

Commit f015410

Browse files
committed
Fixed IE browser compatibles mode
1 parent 1e6b0de commit f015410

7 files changed

Lines changed: 42 additions & 37 deletions

File tree

LICENSE-MIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License (MIT)
22

3-
Copyright (c) 2010-2013 Dmitrii Pakhtinov
3+
Copyright (c) 2010-2014 Dmitrii Pakhtinov
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "history",
33
"repo": "devote/HTML5-History-API",
44
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
5-
"version": "4.1.0",
5+
"version": "4.1.1",
66
"keywords": ["history", "pushState", "replaceState"],
77
"main": "history.js",
88
"scripts": ["history.js"],

history.iegte8.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*!
2-
* History API JavaScript Library v4.1.0
2+
* History API JavaScript Library v4.1.1
33
*
44
* Support: IE8+, FF3+, Opera 9+, Safari, Chrome and other
55
*
6-
* Copyright 2011-2013, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
6+
* Copyright 2011-2014, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
77
*
88
* http://spb-piksel.ru/
99
*
1010
* Dual licensed under the MIT and GPL licenses:
1111
* http://www.opensource.org/licenses/mit-license.php
1212
* http://www.gnu.org/licenses/gpl.html
1313
*
14-
* Update: 2014-03-24 13:14
14+
* Update: 2014-04-29 15:22
1515
*/
1616
(function(window) {
1717
// Prevent the code from running if there is no window.history object
@@ -511,6 +511,7 @@
511511
* the same names.
512512
*/
513513
window['execScript']('Public ' + prop, 'VBScript');
514+
window['execScript']('var ' + prop + ';', 'JavaScript');
514515
} else {
515516
try {
516517
/**

history.iegte8.min.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

history.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* History API JavaScript Library v4.1.0
2+
* History API JavaScript Library v4.1.1
33
*
44
* Support: IE6+, FF3+, Opera 9+, Safari, Chrome and other
55
*
@@ -11,7 +11,7 @@
1111
* http://www.opensource.org/licenses/mit-license.php
1212
* http://www.gnu.org/licenses/gpl.html
1313
*
14-
* Update: 2014-03-24 13:14
14+
* Update: 2014-04-29 15:22
1515
*/
1616
(function(window) {
1717
// Prevent the code from running if there is no window.history object
@@ -511,6 +511,7 @@
511511
* the same names.
512512
*/
513513
window['execScript']('Public ' + prop, 'VBScript');
514+
window['execScript']('var ' + prop + ';', 'JavaScript');
514515
} else {
515516
try {
516517
/**
@@ -1052,7 +1053,7 @@
10521053

10531054
// testing IE browser
10541055
var msie = window['eval'] && eval("/*@cc_on 1;@*/");
1055-
if (!msie || +((/msie (\d+)/i.exec(navigator.userAgent) || [, 8])[1]) > 7) {
1056+
if (!msie || (document.documentMode && document.documentMode > 7)) {
10561057
// If it is not IE or a version greater than seven
10571058
return;
10581059
}
@@ -1175,6 +1176,8 @@
11751176
if (prop === 'state') {
11761177
locationObject = createVBObjects(locationObject);
11771178
window.history = historyObject = createVBObjects(historyObject);
1179+
// hack for IE7
1180+
window['execScript']('var history = window.history;', 'JavaScript');
11781181
}
11791182
} else {
11801183
object[prop] = descriptor.get && descriptor.get();

0 commit comments

Comments
 (0)