mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-18 07:40:42 +00:00
Add rel="noopener noreferrer" to external links
Background: https://medium.com/@jitbit/target-blank-the-most-underestimated-vulnerab ility-ever-96e328301f4c#.hduwdbjlb
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
title: $:/plugins/tiddlywiki/powered-by-tiddlywiki/banner
|
||||
tags: $:/tags/PageTemplate
|
||||
|
||||
<a href="http://tiddlywiki.com" target="_blank">
|
||||
<a href="http://tiddlywiki.com" target="_blank" rel="noopener noreferrer">
|
||||
[img width="160px" class="tc-powered-by-tiddlywiki-banner" [$:/plugins/tiddlywiki/powered-by-tiddlywiki/powered-by-tiddlywiki.svg]]
|
||||
</a>
|
||||
|
||||
@@ -97,6 +97,7 @@ RailroadWidget.prototype.patchLinks = function(node) {
|
||||
if(child.attributes["data-tw-external"]) {
|
||||
// External links are straightforward
|
||||
child.setAttribute("target","_blank");
|
||||
child.setAttribute("rel","noopener noreferrer");
|
||||
} else {
|
||||
// Each internal link gets its own onclick handler, capturing its own copy of target
|
||||
(function(myTarget) {
|
||||
|
||||
Reference in New Issue
Block a user