angularjs - angular rewrite url in html5 mode -
now work in case write chrome extension in gmail, , our extension use ui-router change view, change url xxx/#inbox xxx/#/inbox, block extension features(streak) while customer expect use in same time. enable html5 mode, , rewrite url make work. here rewrite part: app.config(function($provide,$locationprovider,....){ $provide.decorator('$browser', function($delegate) { var superurl = $delegate.url; $delegate.url = function(url, replace) { if(url !== undefined) { return superurl(url.replace(/\%2f/g,"/"), replace); } else { return superurl().replace(/\//, "%2f"); } } return $delegate; }); $locationprovider.html5mode({ enabled: true, requirebase: false, rewritelinks: true }); ...... }) it works fine our part extension, while click streak feature, cause error l