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

Fix #914 #917

Merged
merged 2 commits into from
Dec 2, 2019
Merged

Fix #914 #917

merged 2 commits into from
Dec 2, 2019

Conversation

vkallore
Copy link
Contributor

@vkallore vkallore commented Sep 6, 2019

Summary
Fixes #914
Had raiesed an issue #914 on missing rel="noreferrer noopener" for links opening in new tab/window and done the fix with 'noopener' for links with _blank. Thought not to add 'noreferrer' as it might be useful for referrer info.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:


  • DO NOT include files inside lib directory.

@anikethsaha
Copy link
Member

the motive is to stop opening new tabs right ?
it can be done using _self as well in the target.

Anything extra this is doing ?

@vkallore
Copy link
Contributor Author

vkallore commented Dec 2, 2019

Its not to prevent opening in new tab. Read about the risk of not adding it here

@anikethsaha
Copy link
Member

Its not to prevent opening in new tab. Read about the risk of not adding it here

ahh...make sense. What is the behavior of this PR when externallinktarget is _blank and _self ?

@vkallore
Copy link
Contributor Author

vkallore commented Dec 2, 2019

As you can see in this PR commit #4769018, if the dev forgot to add the externalLinkRel, script will default it to 'noopener' (also read the PR summary). Dev is also allowed to add as required (empty or different as per demands).

Does it make sense?

@anikethsaha
Copy link
Member

I read the description already. What I was asking is whats the behavior of having both externalLinkRel and externalLinktarget ?

@vkallore
Copy link
Contributor Author

vkallore commented Dec 2, 2019

Well, its required only for _blank. It has no effect if any other config value found for linkTarget.

@anikethsaha
Copy link
Member

SO if _blank is provided, and this options is set to noopener (which is by default)` so the blank wont wok right ?

@vkallore
Copy link
Contributor Author

vkallore commented Dec 2, 2019

_blank continues to work as expected. Only addition is ... rel="blah..."... for the <a> tags.

@anikethsaha
Copy link
Member

ohh.....I got it. noopener is for stopping the referer headers to pass.

Ok this is a valid fix.

Could You rebase and fix the conflicts. And then we are good to go 👍

@vkallore
Copy link
Contributor Author

vkallore commented Dec 2, 2019

Resolved the conflicts.

Copy link
Member

@anikethsaha anikethsaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR 🙏

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.

Missing rel="noreferrer noopener" for links opening in new tab/window
2 participants