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

Update router.js #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update router.js #12

wants to merge 1 commit into from

Conversation

ynonp
Copy link

@ynonp ynonp commented Sep 11, 2017

Hi,

Links to external hosts are now automatically ignored

@wesleytodd
Copy link
Owner

Hey @ynonp, thanks for the report!

I believe that the case of external origins, aka el.host !== window.location.host, are handled in the intercept-link-clicks module, which nighthawk uses to intercept all the anchor clicks. Here is the relevant code for that: https://github.com/wesleytodd/intercept-link-clicks/blob/master/index.js#L121

I could very well be wrong, so if you could provide a test case for the issue, I would be happy to resolve this and publish a patch. The test for this behavior in the underlying module can be found here: https://github.com/wesleytodd/intercept-link-clicks/blob/master/test/intercept.js#L88

In theory, if you call onClick directly with your own anchor element you could hit this behavior and bypass intercept-link-clicks, so if something like this is your use case I would love to see an example, and maybe I can help find another way.

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

Successfully merging this pull request may close these issues.

2 participants