Browse Source

nofollow noopener noreferrer

pull/126/head
Lal'C Mellk Mal 3 years ago
parent
commit
5ffe626ca9
5 changed files with 9 additions and 6 deletions
  1. +1
    -1
      client/amusement.js
  2. +1
    -1
      client/posting.js
  3. +4
    -3
      common.js
  4. +2
    -0
      docs/nginx.conf.example
  5. +1
    -1
      tmpl/index.html

+ 1
- 1
client/amusement.js View File

@@ -77,7 +77,7 @@ function construct_banner(parts) {
$banner.empty();
parts.forEach(function (part) {
if (part.href)
$('<a></a>', _.extend({target: '_blank'}, part)
$('<a></a>', _.extend({target: '_blank', rel: 'noopener noreferrer'}, part)
).appendTo($banner);
else
$banner.append(document.createTextNode(part));


+ 1
- 1
client/posting.js View File

@@ -334,7 +334,7 @@ propagate_ident: function () {
var tag = meta.children('a:first');
if (email)
tag.attr({href: 'mailto:' + email, target: '_blank',
'class': 'email'});
'rel': 'nofollow noopener noreferrer', 'class': 'email'});
else
tag.removeAttr('href').removeAttr('target').attr('class',
'nope');


+ 4
- 3
common.js View File

@@ -553,7 +553,7 @@ if (LINKIFY) { OS.linkify = function (text) {
var e = escape_html(bits[i]);
// open in new tab, and disavow target
this.callback(safe('<a href="' + e +
'" rel="nofollow" target="_blank">' +
'" rel="nofollow noopener noreferrer" target="_blank">' +
e + '</a>'));
}
else
@@ -607,7 +607,7 @@ exports.pick_spoiler = pick_spoiler;
function new_tab_link(srcEncoded, inside, cls) {
return [safe('<a href="' + srcEncoded + '" target="_blank"' +
(cls ? ' class="'+cls+'"' : '') +
' rel="nofollow">'), inside, safe('</a>')];
' rel="noreferrer nofollow noopener">'), inside, safe('</a>')];
}


@@ -808,7 +808,8 @@ OS.atama = function (data) {
header.push(safe('</b>'));
if (data.email) {
header.unshift(safe('<a class="email" href="mailto:'
+ encodeURI(data.email) + '" target="_blank">'));
+ encodeURI(data.email)
+ '" ref="noopener noreferrer" target="_blank">'));
header.push(safe('</a>'));
}
header.push(safe(' <time datetime="' + datetime(data.time) +


+ 2
- 0
docs/nginx.conf.example View File

@@ -33,6 +33,8 @@ server {
# The trailing "/" is important.
location /ass/ {
alias /path/to/doushio/www/;
expires 2d;
add_header X-Content-Type-Options nosniff;
}

# Handles image uploads.


+ 1
- 1
tmpl/index.html View File

@@ -8,7 +8,7 @@
$META <!--[if lt IE 9]><script src="{{MEDIA_URL}}js/ie.js"></script><![endif]-->
<script src="{{MEDIA_URL}}js/setup.js?v=6"></script>
</head>
<a id="feedback" href="mailto:{{EMAIL}}" target="_blank">Feedback</a>
<a id="feedback" href="mailto:{{EMAIL}}" target="_blank" ref="noopener noreferrer">Feedback</a>
$NAV
<h1>$TITLE</h1>
<span id="sync">Not synched.</span>


Loading…
Cancel
Save