@@ -123,7 +123,8 @@ function Browser(window, document, $log, $sniffer) {
123
123
// URL API
124
124
//////////////////////////////////////////////////////////////
125
125
126
- var lastBrowserUrl = location . href ;
126
+ var lastBrowserUrl = location . href ,
127
+ baseElement = document . find ( 'base' ) ;
127
128
128
129
/**
129
130
* @ngdoc method
@@ -152,7 +153,11 @@ function Browser(window, document, $log, $sniffer) {
152
153
lastBrowserUrl = url ;
153
154
if ( $sniffer . history ) {
154
155
if ( replace ) history . replaceState ( null , '' , url ) ;
155
- else history . pushState ( null , '' , url ) ;
156
+ else {
157
+ history . pushState ( null , '' , url ) ;
158
+ // Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462
159
+ baseElement . attr ( 'href' , baseElement . attr ( 'href' ) ) ;
160
+ }
156
161
} else {
157
162
if ( replace ) location . replace ( url ) ;
158
163
else location . href = url ;
@@ -231,7 +236,7 @@ function Browser(window, document, $log, $sniffer) {
231
236
* @returns {string= }
232
237
*/
233
238
self . baseHref = function ( ) {
234
- var href = document . find ( 'base' ) . attr ( 'href' ) ;
239
+ var href = baseElement . attr ( 'href' ) ;
235
240
return href ? href . replace ( / ^ h t t p s ? \: \/ \/ [ ^ \/ ] * / , '' ) : href ;
236
241
} ;
237
242
0 commit comments