parent
9e88b1413d
commit
54e8e72ad2
39 changed files with 76 additions and 66 deletions
10
static/js/ng-safenewtab.js
Normal file
10
static/js/ng-safenewtab.js
Normal 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');
|
||||
};
|
||||
});
|
Reference in a new issue