Skip to content

Commit def37cc

Browse files
committed
profile: make help links open in new tabs (#1922)
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
1 parent fb91914 commit def37cc

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

tensorboard/plugins/profile/tf_profile_dashboard/tf-profile-dashboard.html

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@
4848
<h3>Profiling isn’t supported in Colab yet.</h3>
4949
<p>
5050
Please see
51-
<a href="https://github.com/tensorflow/tensorboard/issues/1913">GitHub issue #1913</a>
51+
<a
52+
href="https://github.com/tensorflow/tensorboard/issues/1913"
53+
rel="noopener"
54+
target="_blank"
55+
>GitHub issue #1913</a>
5256
for more information.
5357
</p>
5458
</div>
@@ -65,21 +69,39 @@ <h3>No profile data was found.</h3>
6569
<p>To collect a profile, you need to run your model on Google Cloud TPUs and
6670
capture the trace information while your model is running. You may want to
6771
check out the
68-
<a href="https://github.com/tensorflow/tensorboard/blob/1.6/tensorboard/plugins/profile/README.md">README</a>
72+
<a
73+
href="https://github.com/tensorflow/tensorboard/blob/1.6/tensorboard/plugins/profile/README.md"
74+
rel="noopener"
75+
target="_blank"
76+
>README</a>
6977
and perhaps the
7078
<a
71-
href="https://cloud.google.com/tpu/docs/cloud-tpu-tools"
79+
href="https://cloud.google.com/tpu/docs/cloud-tpu-tools"
80+
rel="noopener"
81+
target="_blank"
7282
>tutorial</a> on how to use the
73-
<a href="https://pypi.python.org/pypi/cloud-tpu-profiler">cloud-tpu-profiler</a>.
83+
<a
84+
href="https://pypi.python.org/pypi/cloud-tpu-profiler"
85+
rel="noopener"
86+
target="_blank"
87+
>cloud-tpu-profiler</a>.
7488
</p>
7589
<p>
7690
If you’re new to TPUs, and want to find out how
7791
to run models, check out the
78-
<a href="https://cloud.google.com/tpu/docs/quickstart">Quickstart Using a TPU</a>.
92+
<a
93+
href="https://cloud.google.com/tpu/docs/quickstart"
94+
rel="noopener"
95+
target="_blank"
96+
>Quickstart Using a TPU</a>.
7997
</p>
8098
<p>
8199
If you think profiling is done properly, please see the page of
82-
<a href="https://cloud.google.com/tpu/docs/troubleshooting">Google Cloud TPU Troubleshooting and FAQ</a>
100+
<a
101+
href="https://cloud.google.com/tpu/docs/troubleshooting"
102+
rel="noopener"
103+
target="_blank"
104+
>Google Cloud TPU Troubleshooting and FAQ</a>
83105
and consider filing an issue on GitHub.</p>
84106
</div>
85107
</template>

0 commit comments

Comments
 (0)