Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom exclude rules #110

Open
ElijZhang opened this issue Dec 31, 2024 · 0 comments
Open

Add custom exclude rules #110

ElijZhang opened this issue Dec 31, 2024 · 0 comments

Comments

@ElijZhang
Copy link

hello, I would like to add a custom exclusion rule to the initialization props, for example:

exclude={[
  // Exclude via data attribute
  '[data-next-top-loader-exclude="true"]',
  // Exclude specific paths
  '/api/*',
  // Exclude by specific class name
  '.no-progress-bar',
]}

and then exclude such <a> tags.

The reason I’m raising this issue is that when I use an <a> tag to download files, I don’t want the top loader to appear, but it still shows up.

const isSpecialScheme = ['tel:', 'mailto:', 'sms:', 'blob:', 'download:'].some((scheme) =>
newUrl.startsWith(scheme)
);

download is an attribute of the <a> tag, not a type of href.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant