Skip to content

Commit 80af64b

Browse files
committed
Added support for tag BASE
1 parent 1203f25 commit 80af64b

6 files changed

Lines changed: 60 additions & 44 deletions

File tree

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.7",
5+
"version": "4.1.8",
66
"keywords": ["history", "pushState", "replaceState"],
77
"main": "history.js",
88
"scripts": ["history.js"],

history.iegte8.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* History API JavaScript Library v4.1.7
2+
* History API JavaScript Library v4.1.8
33
*
44
* Support: IE8+, 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-05-19 16:57
14+
* Update: 2014-06-05 11:54
1515
*/
1616
(function(factory) {
1717
if (typeof define === 'function' && define['amd']) {
@@ -367,7 +367,15 @@
367367
function parseURL(href, isWindowLocation, isNotAPI) {
368368
var re = /(?:([\w0-9]+:))?(?:\/\/(?:[^@]*@)?([^\/:\?#]+)(?::([0-9]+))?)?([^\?#]*)(?:(\?[^#]+)|\?)?(?:(#.*))?/;
369369
if (href != null && href !== '' && !isWindowLocation) {
370-
var current = parseURL(), _pathname = current._pathname, _protocol = current._protocol;
370+
var current = parseURL(),
371+
base = document.getElementsByTagName('base')[0];
372+
if (!isNotAPI && base && base.getAttribute('href')) {
373+
// Fix for IE ignoring relative base tags.
374+
// See http://stackoverflow.com/questions/3926197/html-base-tag-and-local-folder-path-with-internet-explorer
375+
base.href = base.href;
376+
current = parseURL(base.href, null, true);
377+
}
378+
var _pathname = current._pathname, _protocol = current._protocol;
371379
// convert to type of string
372380
href = '' + href;
373381
// convert relative link to the absolute

history.iegte8.min.js

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

history.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* History API JavaScript Library v4.1.7
2+
* History API JavaScript Library v4.1.8
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-05-19 16:57
14+
* Update: 2014-06-05 11:54
1515
*/
1616
(function(factory) {
1717
if (typeof define === 'function' && define['amd']) {
@@ -367,7 +367,15 @@
367367
function parseURL(href, isWindowLocation, isNotAPI) {
368368
var re = /(?:([\w0-9]+:))?(?:\/\/(?:[^@]*@)?([^\/:\?#]+)(?::([0-9]+))?)?([^\?#]*)(?:(\?[^#]+)|\?)?(?:(#.*))?/;
369369
if (href != null && href !== '' && !isWindowLocation) {
370-
var current = parseURL(), _pathname = current._pathname, _protocol = current._protocol;
370+
var current = parseURL(),
371+
base = document.getElementsByTagName('base')[0];
372+
if (!isNotAPI && base && base.getAttribute('href')) {
373+
// Fix for IE ignoring relative base tags.
374+
// See http://stackoverflow.com/questions/3926197/html-base-tag-and-local-folder-path-with-internet-explorer
375+
base.href = base.href;
376+
current = parseURL(base.href, null, true);
377+
}
378+
var _pathname = current._pathname, _protocol = current._protocol;
371379
// convert to type of string
372380
href = '' + href;
373381
// convert relative link to the absolute

0 commit comments

Comments
 (0)