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

profile: make help links open in new tabs #1922

Merged
merged 1 commit into from
Feb 28, 2019

Conversation

wchargin
Copy link
Contributor

Summary:
Not only is opening in new tabs a better user experience, it’s necessary
in notebook contexts so that we don’t try to load the GitHub docs in an
iframe, which would fail because GitHub sets frame-ancestors 'none'.
(When I tested #1914 in Colab, I instinctively Ctrl-clicked the link,
thus not hitting this issue.)

Test Plan:
Tested that in both Jupyter and Colab, clicking on a help link before
this change yields a white frame with a “Refused to display…” console
error, while after this change it opens the appropriate link in a new
tab.

Checked statically that each link has rel="noopener" target="_blank":

$ <./tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html tee \
> >(grep 'href=' | grep -Fcv '<link') \
> >(grep -Fc 'rel="noopener"') \
> >(grep -Fc 'target="_blank"') \
> >/dev/null
6
6
6

wchargin-branch: profile-help-in-new-tab

Summary:
Not only is opening in new tabs a better user experience, it’s necessary
in notebook contexts so that we don’t try to load the GitHub docs in an
iframe, which would fail because GitHub sets `frame-ancestors 'none'`.
(When I tested #1914 in Colab, I instinctively Ctrl-clicked the link,
thus not hitting this issue.)

Test Plan:
Tested that in both Jupyter and Colab, clicking on a help link before
this change yields a white frame with a “Refused to display…” console
error, while after this change it opens the appropriate link in a new
tab.

Checked statically that each link has `rel="noopener" target="_blank"`:

```shell
$ <./tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html tee \
> >(grep 'href=' | grep -Fcv '<link') \
> >(grep -Fc 'rel="noopener"') \
> >(grep -Fc 'target="_blank"') \
> >/dev/null
6
6
6
```

wchargin-branch: profile-help-in-new-tab
Copy link
Contributor

@stephanwlee stephanwlee left a comment

Choose a reason for hiding this comment

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

💯

@wchargin wchargin merged commit 57e4deb into master Feb 28, 2019
@wchargin wchargin deleted the wchargin-profile-help-in-new-tab branch February 28, 2019 18:42
wchargin added a commit to wchargin/tensorboard that referenced this pull request Mar 5, 2019
Summary:
Not only is opening in new tabs a better user experience, it’s necessary
in notebook contexts so that we don’t try to load the GitHub docs in an
iframe, which would fail because GitHub sets `frame-ancestors 'none'`.
(When I tested tensorflow#1914 in Colab, I instinctively Ctrl-clicked the link,
thus not hitting this issue.)

Test Plan:
Tested that in both Jupyter and Colab, clicking on a help link before
this change yields a white frame with a “Refused to display…” console
error, while after this change it opens the appropriate link in a new
tab.

Checked statically that each link has `rel="noopener" target="_blank"`:

```shell
$ <./tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html tee \
> >(grep 'href=' | grep -Fcv '<link') \
> >(grep -Fc 'rel="noopener"') \
> >(grep -Fc 'target="_blank"') \
> >/dev/null
6
6
6
```

wchargin-branch: profile-help-in-new-tab
@wchargin wchargin mentioned this pull request Mar 5, 2019
wchargin added a commit that referenced this pull request Mar 6, 2019
Summary:
Not only is opening in new tabs a better user experience, it’s necessary
in notebook contexts so that we don’t try to load the GitHub docs in an
iframe, which would fail because GitHub sets `frame-ancestors 'none'`.
(When I tested #1914 in Colab, I instinctively Ctrl-clicked the link,
thus not hitting this issue.)

Test Plan:
Tested that in both Jupyter and Colab, clicking on a help link before
this change yields a white frame with a “Refused to display…” console
error, while after this change it opens the appropriate link in a new
tab.

Checked statically that each link has `rel="noopener" target="_blank"`:

```shell
$ <./tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html tee \
> >(grep 'href=' | grep -Fcv '<link') \
> >(grep -Fc 'rel="noopener"') \
> >(grep -Fc 'target="_blank"') \
> >/dev/null
6
6
6
```

wchargin-branch: profile-help-in-new-tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants