This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/ng-safenewtab.js

10 lines
355 B
JavaScript
Raw Permalink Normal View History

2019-11-12 16:09:47 +00:00
/**
* 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');
};
});