fish-shell/doc_src/user_doc.footer.html
Mahmoud Al-Qudsi 80b658e247 Work around OS X issue with dropped #fragment in launched URLs
The previous hack used to work around an OS X issue/bug where launching
a URL with a #fragment appended would drop the fragment by using
`osascript` does not seem to work any more. Append the section name as a
query string (in addition to, not instead of #section) and then use some
basic javascript appended to the user doc HTML template to parse that
and jump to the correct section (if the section was dropped).

Closes #4480
2017-10-18 12:11:20 -05:00

12 lines
465 B
HTML

</body>
<script type='text/javascript'>
// Some platforms don't handle launching a browser to navigate a page with
// a #fragment specified, so we use this workaround combined with a query string.
// See https://github.com/fish-shell/fish-shell/issues/4480
var params = new URLSearchParams(window.location.search); //?section=foo
var section = params.get("section");
if (section != null && location.hash == "") {
location.hash = "#" + section;
}
</script>
</html>