PageSourceSearch

https://cdn.hana-yume.net/js/common/giveAttributes.js?v=a5de8d65d66c4b0214c3145d012974668a9243be

js hana-yume.net collected 2026-10-03 23:27:02 UTC 1,247 bytes, 37 lines download raw bytes

1/*-------------------------------------------------------------------------
2  セキュリティ対策のため、target="_blank"のaタグに 
3  "noopener noreferrer"のrel属性を自動で付与する
4-------------------------------------------------------------------------*/
5function ready(fn) {
6  if (document.readyState != 'loading') {
7    fn();
8  } else if (document.addEventListener) {
9    document.addEventListener('DOMContentLoaded', fn);
10  } else {
11    document.attachEvent('onreadystatechange', function() {
12      if (document.readyState != 'loading')
13        fn();
14    });
15  }
16}
17
18ready(function(){
19  var aTags = [].slice.call(document.getElementsByTagName('a'));
20  var userAgent = window.navigator.userAgent.toLowerCase();
21  var isIE = (~userAgent.indexOf('msie') || ~userAgent.indexOf('trident'));
22  if (!isIE) {
23    aTags.forEach(function (el) {
24      if (el.target === '_blank') {
25        var rels = el.rel.split(' ');
26        if (!~rels.indexOf('noopener')) {
27          rels.push('noopener');
28          el.setAttribute('rel', rels.join(' ').trim());
29        }
30        if (!~rels.indexOf('noreferrer')) {
31          rels.push('noreferrer');
32          el.setAttribute('rel', rels.join(' ').trim());
33        }
34      }
35    });
36  }
37});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.