Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066476
D5969.id21573.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D5969.id21573.diff
View Options
diff --git a/assets/src/bundles/admin/origin-save.js b/assets/src/bundles/admin/origin-save.js
--- a/assets/src/bundles/admin/origin-save.js
+++ b/assets/src/bundles/admin/origin-save.js
@@ -92,7 +92,8 @@
} else {
html += sanitizedURL;
}
- html += ` <a href="${sanitizedURL}"><i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>`;
+ html += ` <a href="${sanitizedURL}" target="_blank" rel="noopener noreferrer">` +
+ '<i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>';
return html;
}
return data;
diff --git a/assets/src/bundles/save/index.js b/assets/src/bundles/save/index.js
--- a/assets/src/bundles/save/index.js
+++ b/assets/src/bundles/save/index.js
@@ -194,7 +194,8 @@
} else {
html += sanitizedURL;
}
- html += ` <a href="${sanitizedURL}"><i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>`;
+ html += ` <a href="${sanitizedURL}" target="_blank" rel="noopener noreferrer">` +
+ '<i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>';
return html;
}
return data;
diff --git a/cypress/integration/origin-save.spec.js b/cypress/integration/origin-save.spec.js
--- a/cypress/integration/origin-save.spec.js
+++ b/cypress/integration/origin-save.spec.js
@@ -277,7 +277,7 @@
} else {
html += this.originSaveJSON.data[i].origin_url;
}
- html += ` <a href="${this.originSaveJSON.data[i].origin_url}">`;
+ html += ` <a href="${this.originSaveJSON.data[i].origin_url}" target="_blank" rel="noopener noreferrer">`;
html += '<i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>';
assert.equal($(cells[2]).html(), html);
assert.equal($(cells[3]).text(), this.originSaveJSON.data[i].save_request_status);
diff --git a/swh/web/templates/includes/snapshot-context.html b/swh/web/templates/includes/snapshot-context.html
--- a/swh/web/templates/includes/snapshot-context.html
+++ b/swh/web/templates/includes/snapshot-context.html
@@ -14,7 +14,8 @@
{{ snapshot_context.origin_info.url }}
</a>
{% if snapshot_context.origin_info.url|slice:"0:4" == "http" %}
- <a href="{{ snapshot_context.origin_info.url }}" title="Go to origin">
+ <a href="{{ snapshot_context.origin_info.url }}"
+ target="_blank" rel="noopener noreferrer" title="Go to origin">
<i class="mdi mdi-open-in-new" aria-hidden="true"></i>
</a>
{% endif %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 11:45 AM (11 w, 15 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220665
Attached To
D5969: templates/snapshot-context: Visit origin URL in a new browser tab
Event Timeline
Log In to Comment