pace
pace copied to clipboard
Unable to ignore specific url
How do you correctly use the following code :
Pace.options = {
ajax: {
ignoreURLs: ['some-substring', /some-regexp/]
}
}
Hey !
I'm not sure, so if others could confirm...
Example which will ignore all AJAX requests to www.facebook.com : Pace.options = { ajax: { ignoreURLs: ['facebook'' } }
Note that it won't ignore requests to http://fbstatic.com, ... And only ignore ajax.
Thanks for this addon!
I am also facing this issue recently: If an url which has no query params is given, ex: /abc then the ignoring happens. But if an url contains query params like /abc?x=1 then the GET request is not ignored.
I confirm this:
var options = {
ajax: {
trackMethods: ['GET', 'POST'],
ignoreURLs: [/.*ballot.*/]
},
restartOnPushState: false
};
or this:
var options = {
ajax: {
trackMethods: ['GET', 'POST'],
ignoreURLs: ['ballot']
},
restartOnPushState: false
};
will not ignore this request:
/api/bill/ballot/56feab967676c9ea6b0b471a?_=1459971253942
So the ignoreURLs
option is broken IMHO.
Any update on this?
Thanks,
@promethe42 I use tawk.to chat online plugin and I need to ignore it because it took forever for the progress to end. I use your code (ignoreURLs: [/.ballot./]) and it works well. thanks.
@sorryjack how do you ignore the tawk.to chat online plugin ya? i tried to use the solution above, but it stills taking forever to end.
thanks ya.
@wynterz Try this bro:
<script type="text/javascript"> window.paceOptions = { ajax: { trackMethods: ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'], ignoreURLs: [/.*tawk.*/] } } </script>
@sorryjack This only fades it for me, is there an alternative solution?
-- i am using react
Thanks @sorryjack ! That worked for me. I'm using Angular, so I put the script on my index.html like this:
<script type="text/javascript"> window.paceOptions = { ajax: { trackMethods: ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'], ignoreURLs: ['https://www.google.com'] } } </script>
Will this ONLY ignore ajax requests? I have a page that loads various external URLs, some of which are very slow. I'm fading in a div upon pace finishing, but these slow (non-critical) external URLs are making the fade transition take a long time.