There seems to be an issue in only Safari that causes the matching route handler to fire twice when the page is first loaded when using pushState. It seems related to the window's popstate event being fired on page load.
Here is an example of the code causing the issue:
var router = new Grapnel({ pushState : true });
router.get('/test/:id?', function(req) {
console.log('Route handler fired', req.params.id);
});
There seems to be an issue in only Safari that causes the matching route handler to fire twice when the page is first loaded when using pushState. It seems related to the window's
popstate
event being fired on page load.Here is an example of the code causing the issue:
Tested using Safari 8.0.2.
Awesome plugin, keep up the great work!