pace icon indicating copy to clipboard operation
pace copied to clipboard

Unable to ignore specific url

Open nathvarun opened this issue 9 years ago • 10 comments

How do you correctly use the following code :

Pace.options = { ajax: { ignoreURLs: ['some-substring', /some-regexp/] } }

nathvarun avatar May 26 '15 16:05 nathvarun

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.

r9mp avatar Jun 17 '15 08:06 r9mp

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.

abhilashlr avatar Aug 29 '15 02:08 abhilashlr

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.

JMLX42 avatar Apr 06 '16 19:04 JMLX42

Any update on this?

Thanks,

JMLX42 avatar Jun 09 '16 12:06 JMLX42

@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 avatar Nov 28 '16 08:11 sorryjack

@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 avatar Aug 11 '17 14:08 wynterz

@wynterz Try this bro: <script type="text/javascript"> window.paceOptions = { ajax: { trackMethods: ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'], ignoreURLs: [/.*tawk.*/] } } </script>

sorryjack avatar Aug 19 '17 16:08 sorryjack

@sorryjack This only fades it for me, is there an alternative solution?

-- i am using react

djoq avatar Oct 04 '17 07:10 djoq

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>

mpintener avatar Jun 12 '18 14:06 mpintener

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.

brentarcane avatar Jul 05 '18 18:07 brentarcane