Fix all target="_blank" anchors to be safer

Fixes #1411
This commit is contained in:
Joseph Schorr 2016-04-28 14:38:22 -04:00
parent 9e88b1413d
commit 54e8e72ad2
39 changed files with 76 additions and 66 deletions

View file

@ -0,0 +1,10 @@
/**
* Adds both target="_blank" and rel="noopener" to the marked anchor tag.
* Background on noopener: https://mathiasbynens.github.io/rel-noopener/
*/
angular.module('quay').directive('ngSafenewtab', function () {
return function (scope, element, attr) {
element.attr('target', '_blank');
element.attr('rel', 'noopener');
};
});