This repository has been archived on 2020-03-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
quay/static/js/ng-safenewtab.js
2016-05-05 14:00:17 -04:00

10 lines
No EOL
355 B
JavaScript

/**
* 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 noreferrer');
};
});