diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-10-14 02:01:18 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-10-14 02:01:21 -0700 |
commit | c40e9bc039b425b385a478cbbbc46df934c98961 (patch) | |
tree | c99a336b245fff0093714ed9b803340a3a6ee4ea /fatcat_scholar | |
parent | 67104f3bb3d7cb21b57ed7f394154b91810faa3a (diff) | |
download | fatcat-scholar-c40e9bc039b425b385a478cbbbc46df934c98961.tar.gz fatcat-scholar-c40e9bc039b425b385a478cbbbc46df934c98961.zip |
web: rel=noopener for outlinks
Via Lighthouse. Apparently destination pages can reach-back to the
opening window via JS API. Weird!
Note that instead of noreferrer, we have a meta tag to have off-domain
(off-origin) links only include the origin name (eg, hostname) instead
of full URL with query paths. So we don't forward user queries to
non-archive.org domains.
Diffstat (limited to 'fatcat_scholar')
-rw-r--r-- | fatcat_scholar/templates/base.html | 20 | ||||
-rw-r--r-- | fatcat_scholar/templates/home.html | 8 | ||||
-rw-r--r-- | fatcat_scholar/templates/search.html | 8 | ||||
-rw-r--r-- | fatcat_scholar/templates/search_macros.html | 26 |
4 files changed, 31 insertions, 31 deletions
diff --git a/fatcat_scholar/templates/base.html b/fatcat_scholar/templates/base.html index 8577b18..55a0082 100644 --- a/fatcat_scholar/templates/base.html +++ b/fatcat_scholar/templates/base.html @@ -220,12 +220,12 @@ <p style="color: rgba(255, 255, 255, 0.5);"> {% trans %}We are a US 501(c)(3) non-profit library, building a global archive of Internet sites and other cultural artifacts in digital form.{% endtrans %} - {% trans %}Other projects include{% endtrans %} <a target="_blank" href="https://web.archive.org">The Wayback Machine</a>, <a target="_blank" href="https://archive.org">archive.org</a>, <a target="_blank" href="https://openlibrary.org">Open Library</a> and <a target="_blank" href="https://archive-it.org">Archive-It</a> + {% trans %}Other projects include{% endtrans %} <a target="_blank" rel="noopener" href="https://web.archive.org">The Wayback Machine</a>, <a target="_blank" rel="noopener" href="https://archive.org">archive.org</a>, <a target="_blank" rel="noopener" href="https://openlibrary.org">Open Library</a> and <a target="_blank" rel="noopener" href="https://archive-it.org">Archive-It</a> <div class="ui horizontal inverted link list"> - <a class="item" target="_blank" href="https://archive.org/about/">{{ _("About Us") }}</a> - <a class="item" target="_blank" href="https://archive.org/about/contact.php">{{ _("Contact Us") }}</a> - <a class="item" target="_blank" href="https://archive.org/about/terms.php">{{ _("Policies") }}</a> - <a class="item" target="_blank" href="https://archive.org/donate">{{ _("Donate") }}</a> + <a class="item" target="_blank" rel="noopener" href="https://archive.org/about/">{{ _("About Us") }}</a> + <a class="item" target="_blank" rel="noopener" href="https://archive.org/about/contact.php">{{ _("Contact Us") }}</a> + <a class="item" target="_blank" rel="noopener" href="https://archive.org/about/terms.php">{{ _("Policies") }}</a> + <a class="item" target="_blank" rel="noopener" href="https://archive.org/donate">{{ _("Donate") }}</a> </div> </div> </div> @@ -242,11 +242,11 @@ <div class="three wide column"> <h4 class="ui inverted header">{% trans %}Open Infrastructure{% endtrans %}</h4> <div class="ui inverted link list"> - <a target="_blank" href="https://fatcat.wiki" class="item">{{ _("Editable Catalog (Fatcat)") }}</a> - <a target="_blank" href="https://guide.fatcat.wiki" class="item">{{ _("Contribute") }}</a> - <a target="_blank" href="/api/redoc" class="item">{{ _("Search API") }}</a> - <a target="_blank" href="https://status.fatcat.wiki" class="item">{{ _("Service Status") }}</a> - <a target="_blank" href="https://github.com/internetarchive/fatcat-scholar" class="item">{{ _("Source Code") }}</a> + <a target="_blank" rel="noopener" href="https://fatcat.wiki" class="item">{{ _("Editable Catalog (Fatcat)") }}</a> + <a target="_blank" rel="noopener" href="https://guide.fatcat.wiki" class="item">{{ _("Contribute") }}</a> + <a target="_blank" rel="noopener" href="/api/redoc" class="item">{{ _("Search API") }}</a> + <a target="_blank" rel="noopener noreferrer" href="https://status.fatcat.wiki" class="item">{{ _("Service Status") }}</a> + <a target="_blank" rel="noopener noreferrer" href="https://github.com/internetarchive/fatcat-scholar" class="item">{{ _("Source Code") }}</a> </div> </div> </div> diff --git a/fatcat_scholar/templates/home.html b/fatcat_scholar/templates/home.html index dbf7531..7c430fe 100644 --- a/fatcat_scholar/templates/home.html +++ b/fatcat_scholar/templates/home.html @@ -45,7 +45,7 @@ <div class="ui four doubling cards"> <div class="ui card" style="max-width: 250px;"> - <a class="image" href="https://web.archive.org/web/20171006225602/https://burnstrauma.biomedcentral.com/track/pdf/10.1186/s41038-017-0090-z?site=burnstrauma.biomedcentral.com" target="_blank"> + <a class="image" href="https://web.archive.org/web/20171006225602/https://burnstrauma.biomedcentral.com/track/pdf/10.1186/s41038-017-0090-z?site=burnstrauma.biomedcentral.com" target="_blank" rel="noopener"> <img src="/static/thumbnail-c9e87f84.jpg" alt="PDF thumbnail"> </a> <div class="content"> @@ -59,7 +59,7 @@ </div> <div class="ui card" style="max-width: 250px;"> - <a class="image" href="https://web.archive.org/web/20200328205104/http://europepmc.org/backend/ptpmcrender.fcgi?accid=PMC5180799&blobtype=pdf" target="_blank"> + <a class="image" href="https://web.archive.org/web/20200328205104/http://europepmc.org/backend/ptpmcrender.fcgi?accid=PMC5180799&blobtype=pdf" target="_blank" rel="noopener"> <img src="/static/thumbnail-1e13eaf1.jpg" alt="PDF thumbnail"> </a> <div class="content"> @@ -73,7 +73,7 @@ </div> <div class="ui card tablet-hide" style="max-width: 250px;"> - <a class="image" href="https://web.archive.org/web/2017/http://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0010071&type=printable" target="_blank"> + <a class="image" href="https://web.archive.org/web/2017/http://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0010071&type=printable" target="_blank" rel="noopener"> <img src="/static/thumbnail-60cd26da.jpg" alt="PDF thumbnail"> </a> <div class="content"> @@ -87,7 +87,7 @@ </div> <div class="ui card mobile-hide" style="max-width: 250px;"> - <a class="image" href="https://web.archive.org/web/20180730094628/https://www.jstage.jst.go.jp/article/hrj/10/2/10_2_267/_pdf" target="_blank"> + <a class="image" href="https://web.archive.org/web/20180730094628/https://www.jstage.jst.go.jp/article/hrj/10/2/10_2_267/_pdf" target="_blank" rel="noopener"> <img src="/static/thumbnail-7a56065b.jpg" alt="PDF thumbnail"> </a> <div class="content"> diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html index 21d209f..dd7fcd6 100644 --- a/fatcat_scholar/templates/search.html +++ b/fatcat_scholar/templates/search.html @@ -124,10 +124,10 @@ <a href="{{ lang_prefix }}/search" class="ui primary button" style="margin: 0.5em;">{{ _("Start Over") }}</a> </div> <div class="inline"> - <a href="https://archive.org/search.php?sin=TXT&query={{ query.q|urlencode }}" target="_blank" class="ui button" style="margin: 0.5em;">Try archive.org</a> - <a href="https://fatcat.wiki/search&q={{ query.q|urlencode }}" target="_blank" class="ui button" style="margin: 0.5em;">Try fatcat.wiki</a> - <a href="https://www.semanticscholar.org/search?q={{ query.q|urlencode }}" target="_blank" class="ui button" style="margin: 0.5em;">Try Semantic Scholar</a> - <a href="https://scholar.google.com/scholar?q={{ query.q|urlencode }}" target="_blank" class="ui button" style="margin: 0.5em;">Try Google Scholar</a> + <a href="https://archive.org/search.php?sin=TXT&query={{ query.q|urlencode }}" target="_blank" rel="noopener" class="ui button" style="margin: 0.5em;">Try archive.org</a> + <a href="https://fatcat.wiki/search&q={{ query.q|urlencode }}" target="_blank" rel="noopener" class="ui button" style="margin: 0.5em;">Try fatcat.wiki</a> + <a href="https://www.semanticscholar.org/search?q={{ query.q|urlencode }}" rel="noopener" target="_blank" rel="noopener" class="ui button" style="margin: 0.5em;">Try Semantic Scholar</a> + <a href="https://scholar.google.com/scholar?q={{ query.q|urlencode }}" target="_blank" rel="noopener" class="ui button" style="margin: 0.5em;">Try Google Scholar</a> </div> </div> {% else %} diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 3f2826f..3899144 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -31,7 +31,7 @@ <div style="margin-bottom: 0.1em; font-size: 1.2em; font-weight: bold;"> {% if paper.doc_type == "work" %} - <a href="https://fatcat.wiki/release/{{ paper.biblio.release_ident }}" style="color: #2224c7;" target="_blank"> + <a href="https://fatcat.wiki/release/{{ paper.biblio.release_ident }}" style="color: #2224c7;" target="_blank" rel="noopener"> {% if paper.biblio.title %} {{ paper.biblio.title[:512] }} {% if paper.biblio.title|length > 512 %}...{% endif %} @@ -61,7 +61,7 @@ {% endif %} {% elif paper.doc_type == "sim_page" %} - <a target="_blank" href="https://archive.org/details/{{ paper.ia_sim.issue_item }}/page/{{ paper.ia_sim.first_page }}" style="color: #2224c7;">Page {{ paper.ia_sim.first_page }}</a> <a target="_blank" href="https://archive.org/details/{{ paper.ia_sim.issue_item }}" style="color: #2224c7;">of {{ paper.biblio.container_name }} Vol. {{ paper.biblio.volume }}, Issue {{ paper.biblio.issue }}</a> + <a target="_blank" rel="noopener" href="https://archive.org/details/{{ paper.ia_sim.issue_item }}/page/{{ paper.ia_sim.first_page }}" style="color: #2224c7;">Page {{ paper.ia_sim.first_page }}</a> <a target="_blank" rel="noopener" href="https://archive.org/details/{{ paper.ia_sim.issue_item }}" style="color: #2224c7;">of {{ paper.biblio.container_name }} Vol. {{ paper.biblio.volume }}, Issue {{ paper.biblio.issue }}</a> <span style="font-weight: normal; text-transform: uppercase; font-weight: bold;">[{{ _("page") }}]</span> {% endif %} @@ -83,9 +83,9 @@ {% if paper.biblio.container_name %} <i> {% if paper.biblio.container_ident %} - <a target="_blank" href="https://fatcat.wiki/container/{{ paper.biblio.container_ident }}" style="color: black;">{{ paper.biblio.container_name }}</a> + <a target="_blank" rel="noopener" href="https://fatcat.wiki/container/{{ paper.biblio.container_ident }}" style="color: black;">{{ paper.biblio.container_name }}</a> {% elif paper.doc_type == "sim_page" %} - <a target="_blank" href="https://archive.org/details/{{ paper.ia_sim.pub_collection }}" style="color: black;">{{ paper.biblio.container_name }}</a> + <a target="_blank" rel="noopener" href="https://archive.org/details/{{ paper.ia_sim.pub_collection }}" style="color: black;">{{ paper.biblio.container_name }}</a> {% else %} {{ paper.biblio.container_name }} {% endif %} @@ -130,19 +130,19 @@ {# ### IDENTIFIERS #} {% if paper.biblio.doi %} - <a target="_blank" href="https://doi.org/{{paper.biblio.doi }}" style="color: green;">doi:{{ paper.biblio.doi }}</a> + <a target="_blank" rel="noopener noreferrer" href="https://doi.org/{{paper.biblio.doi }}" style="color: green;">doi:{{ paper.biblio.doi }}</a> {% endif %} {% if paper.biblio.pmid %} - <a target="_blank" href="https://www.ncbi.nlm.nih.gov/pubmed/{{paper.biblio.pmid }}" style="color: green;">pmid:{{ paper.biblio.pmid }}</a> + <a target="_blank" rel="noopener" href="https://www.ncbi.nlm.nih.gov/pubmed/{{paper.biblio.pmid }}" style="color: green;">pmid:{{ paper.biblio.pmid }}</a> {% endif %} {% if paper.biblio.pmcid %} - <a target="_blank" href="https://pubmed.ncbi.nlm.nih.gov/{{paper.biblio.pmcid }}/" style="color: green;">pmcid:{{ paper.biblio.pmcid }}</a> + <a target="_blank" rel="noopener" href="https://pubmed.ncbi.nlm.nih.gov/{{paper.biblio.pmcid }}/" style="color: green;">pmcid:{{ paper.biblio.pmcid }}</a> {% endif %} {% if paper.biblio.arxiv_id %} - <a target="_blank" href="https://arxiv.org/abs/{{paper.biblio.arxiv_id }}" style="color: green;">arXiv:{{ paper.biblio.arxiv_id }}</a> + <a target="_blank" rel="noopener" href="https://arxiv.org/abs/{{paper.biblio.arxiv_id }}" style="color: green;">arXiv:{{ paper.biblio.arxiv_id }}</a> {% endif %} {% if paper.biblio.release_ident %} - <a target="_blank" href="https://fatcat.wiki/release/{{paper.biblio.release_ident}}" style="color: green;">fatcat:{{ paper.biblio.release_ident}}</a> + <a target="_blank" rel="noopener" href="https://fatcat.wiki/release/{{paper.biblio.release_ident}}" style="color: green;">fatcat:{{ paper.biblio.release_ident}}</a> {% endif %} <div style="margin-top: 0.2em;"> @@ -151,7 +151,7 @@ {# TODO: remove doc for ES 7.x-style lack of type #} {# TODO: only show 'json' link if from cluster? #} {% if debug_mode %} - <a target="_blank" href="{{ settings.ELASTICSEARCH_BACKEND }}/{{ settings.ELASTICSEARCH_FULLTEXT_INDEX }}/_doc/{{ paper.key }}"> + <a target="_blank" rel="noopener" href="{{ settings.ELASTICSEARCH_BACKEND }}/{{ settings.ELASTICSEARCH_FULLTEXT_INDEX }}/_doc/{{ paper.key }}"> <span class="ui label small" title="search document JSON debug link">json</span> </a> {% endif %} @@ -260,19 +260,19 @@ {% if paper.fulltext and paper.fulltext.access_url %} {% if paper.fulltext.thumbnail_url %} <div class="ui serp card" style="margin-bottom: 0.2em;"> - <a class="image" target="_blank" href="{{ paper.fulltext.access_url}}"> + <a class="image" target="_blank" rel="noopener" href="{{ paper.fulltext.access_url}}"> <img src="{{ paper.fulltext.thumbnail_url }}"> </a> </div> {% else %} <div class="ui serp card" style="margin-bottom: 0.2em; box-shadow: none;"> - <a class="image" target="_blank" href="{{ paper.fulltext.access_url}}" style="background: none;"> + <a class="image" target="_blank" rel="noopener" href="{{ paper.fulltext.access_url}}" style="background: none;"> <img src="/static/document-icon.svg" style="opacity: 0.6;"> </a> </div> {% endif %} <div class="fulltext-link" style="width: 100%; opacity: 1.0; text-align: center; overflow: hidden;"> - <a target="_blank" href="{{ paper.fulltext.access_url}}"> + <a target="_blank" rel="noopener" href="{{ paper.fulltext.access_url}}"> <span> {% if paper.fulltext.access_type == "wayback" %} web.archive.org |