add rel="noopener" to links opening in new tabs
authorFrédéric Péters <fpeters@0d.be>
Sat, 23 May 2020 19:11:59 +0000 (21:11 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 23 May 2020 19:11:59 +0000 (21:11 +0200)
panikweb_templates/static/js/specifics.js
panikweb_templates/templates/includes/audio.html

index 32a7f17..b679328 100644 (file)
@@ -135,6 +135,7 @@ $(function() {
                                        return false;
                                }else{
                                        $(this).attr('target','_blank');
+                                       $(this).attr('rel', 'noopenenr');
                                        $("#All a, #All area").removeClass('loading');
                                        return true;
                                }
index e23cce2..673452d 100644 (file)
                        ><span class="sr-only">{% trans "Download file" %}</span></button>
                <div class="download-links hidden-download-links">
                        {% if sound|is_format_available:'ogg' %}
-                       <a target="_blank" class="button inBlock" href="{{ sound|format_url:'ogg' }}">
+                       <a target="_blank" rel="noopener" class="button inBlock" href="{{ sound|format_url:'ogg' }}">
                                <span class="icon-file">&nbsp;ogg</span>
                        </a>
                        {% endif %}
                        {% if sound|is_format_available:'mp3' %}
-                       <a target="_blank" class="button inBlock" href="{{ sound|format_url:'mp3' }}">
+                       <a target="_blank" rel="noopener" class="button inBlock" href="{{ sound|format_url:'mp3' }}">
                                <span class="icon-file">&nbsp;mp3</span>
                        </a>
                        {% endif %}