As usual, we must increment those version numbers when changes are made
to style.css and/or script.js. That purges the production cache.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
As usual, we must increment those version numbers when changes are made
to style.css and/or script.js. That purges the production cache.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
As usual, we must increment those version numbers when changes are made
to style.css and/or script.js. That purges the production cache.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
The local storage API returns strings and has no way to set a default
value in case no value exists. We must therefore check for the "true"
string or the null value.
Let's extract it from the if boolean expression. We go from:
if (isWidescreen && (showSidebar === "true" || showSidebar === null))
To:
if (isWidescreen && showSidebar)
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Backwards compatibility for browsers without svg support (in this
version) causes the logo to unnecessarily flicker on navigation.
According to caniuse.com SVG in img elements is supported in browsers
used by 97.85% of users. https://caniuse.com/svg-img
Firefox introduced support in 2011, Chrome in 2013, Safari in 2015.
This parameter makes the server return a response with raw file
contents and headers that cause the browser to show a 'save as' dialog.
Regarding Content-Security-Policy:
https://www.w3.org/TR/CSP2/#sandbox-usage
> For example, a message board or email system might provide downloads of
> arbitrary attachments provided by other users. Attacks that rely on tricking
> a client into rendering one of these attachments could be mitigated by
> requesting that resources only be rendered in a very restrictive sandbox.
> Sending the sandbox directive with an empty value establishes such an
> environment:
>
> Content-Security-Policy: sandbox
https://www.w3.org/TR/CSP2/#directive-default-src
> Given this behavior, one good way of building a policy for a site would be to
> begin with a default-src of 'none', and to build up a policy from there that
> contains only those resource types which are actually in use for the page
> you’d like to protect. If you don’t use webfonts, for instance, there’s no
> reason to specify a source list for font-src; specifying only those resource
> types a page uses ensures that the possible attack surface for that page
> remains as small as possible.
https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#defense-in-depth
> A strong CSP provides an effective second layer of protection against various
> types of vulnerabilities, especially XSS. Although CSP doesn't prevent web
> applications from containing vulnerabilities, it can make those
> vulnerabilities significantly more difficult for an attacker to exploit.
The idea is to prevent the browser from loading any external resources, if it
turned out it's possible to trick it into interpreting a file as HTML.
Added an ability to customize contents of meta description tag in
templates that inherit from layout. This replaces the default
description previously used in all views.
This change could help with SEO and missing descriptions in search
results (#167). It's based on advice from
https://developers.google.com/search/docs/appearance/snippet
> Create unique descriptions for each page on your site
> Programmatically generate descriptions
This is not guaranteed to fix the issue, search engines are opaque.
All custom descriptions start with "Elixir Cross Referencer - ".
Currently customized descriptions:
* source - path to the file, project name and version
* ident - name of the searched identifier, project name and version
Everything else uses the previous, default description.
Nowadays smartphones are long but narrow. On many devices, the sidebar
is visible (and impossible to hide) in landscape mode.
Long term it would be better to implement sidebar hiding regardless of
device size, but that may require cookies - otherwise some people will
have to hide the sidebar manually on all links.
This commit adds a small piece of Javascript code to force browsers to forget
about incorrectly issued 301 redirects from "latest" versions.
This code only runs for root project paths (i.e. `/linux/v6.10.2/source`, but
not `/linux/v6.10.2/source/arch`) - other links with "latest" will remain
broken for people who visited them (at least until they clear their cache).
Initial implementation of a new mode in which clicking on an
identifier creates a HTML popup instead of redirecting to a new page.
Skip popup if ctrl/shift/meta is held. Fix generateDocComments
Add ident css class to more ident links (docs, dtb, config...)
Make popup positioning more predicatble
* Attempt to move the popup if a part of it is rendered outside of the viewport
* Make popup full-width on smartphone/small tablet devices
Hide popup on escape click
Add "use strict" and fix undeclared variable errors
To do that we use a slightly modified version of the script found here:
https://github.com/autocompletejs/autocomplete.js/tree/2.7
This code is under MIT licence so it's compatible with Elixir's licence
The server answers requests from the script via a new interface:
https://elixir.bootlin.com/acp?q=<query>&f=<family>&p=<project>
And this is handled by autocomplete.py
The script creates and uses a tmp file to store idents for each project
in order to reduce the time needed to answer a request.
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>