diff --git a/src/ng/browser.js b/src/ng/browser.js index 6acb8baa432a..16a5582ffbcd 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -165,7 +165,8 @@ function Browser(window, document, $log, $sniffer) { return self; // getter } else { - return location.href; + // the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 + return location.href.replace(/%27/g,"'"); } }; diff --git a/test/ng/browserSpecs.js b/test/ng/browserSpecs.js index bd3feed76b23..55b8167ce12e 100644 --- a/test/ng/browserSpecs.js +++ b/test/ng/browserSpecs.js @@ -462,6 +462,12 @@ describe('browser', function() { it('should return $browser to allow chaining', function() { expect(browser.url('http://any.com')).toBe(browser); }); + + + it('should decode single quotes to work around FF bug 407273', function() { + fakeWindow.location.href = "http://ff-bug/?single%27quote"; + expect(browser.url()).toBe("http://ff-bug/?single'quote"); + }); }); describe('urlChange', function() {