Add noreferrer noopener to external URL

issue9089
review289401002
This commit is contained in:
Cédric Krier
2020-03-09 18:08:24 +01:00
parent 3a079ab1d6
commit bdad20516f
4 changed files with 10 additions and 6 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add noreferrer noopener to external URL (issue9089)
* Manage readonly dates in calendar view
* Manage editable on calendar view
* Manage named separator as label
+2 -1
View File
@@ -3210,7 +3210,8 @@
.append(jQuery('<a/>', {
'class': 'btn btn-link',
href: Sao.config.bug_url,
target: '_blank'
target: '_blank',
rel: 'noreferrer noopener',
}).text(Sao.i18n.gettext('Report Bug')))));
jQuery('<button/>', {
'class': 'btn btn-primary',
+3 -1
View File
@@ -3915,7 +3915,8 @@ function eval_pyson(value){
Sao.View.Form.URL._super.init.call(this, view, attributes);
this.button = jQuery('<a/>', {
'class': 'btn btn-default',
'target': '_new'
'target': '_blank',
'rel': 'noreferrer noopener',
}).appendTo(jQuery('<span/>', {
'class': 'input-group-btn'
}).appendTo(this.group));
@@ -3997,6 +3998,7 @@ function eval_pyson(value){
this.button = jQuery('<a/>', {
'class': 'btn btn-lnk',
'target': '_blank',
'rel': 'noreferrer noopener',
}).text(attributes.string).appendTo(this.el);
if (attributes.translate) {
var button = jQuery('<button/>', {
+4 -4
View File
@@ -1870,7 +1870,8 @@
var cell;
if (this.protocol) {
cell = jQuery('<a/>', {
'target': '_new'
'target': '_blank',
'rel': 'noreferrer noopener',
});
cell.append(jQuery('<img/>'));
cell.click({'cell': cell}, this.clicked.bind(this));
@@ -1911,7 +1912,7 @@
break;
}
}
cell.attr('src', value);
cell.attr('href', value);
}
if (this.icon) {
if (this.icon in record.model.fields) {
@@ -1951,8 +1952,7 @@
return cell;
},
clicked: function(event) {
event.preventDefault(); // prevent edition
window.open(event.data.cell.attr('src'), '_blank');
event.stopPropagation(); // prevent edition
}
});