Show
Ignore:
Timestamp:
08/05/08 20:19:38 (4 months ago)
Author:
anekos
Message:

・見えていない要素は無視するようにした。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/auto_detect_link.js

    r16885 r17111  
    239239 
    240240 
     241  // 要素が表示されているか? 
     242  function isVisible (element) { 
     243    return !(element.style && element.style.display.match(/none/)) && (!element.parentNode || isVisible(element.parentNode)) 
     244  } 
     245 
     246 
    241247  // リンクのフィルタ 
    242   function linkFilter (link) { 
    243     return link.href && !link.href.match(/@/) && link.href.match(/^((https?|file|ftp):\/\/|javascript:)/) && link.textContent; 
     248  function linkElementFilter (elem) { 
     249    return isVisible(elem) && elem.href && !elem.href.match(/@/) && elem.href.match(/^((https?|file|ftp):\/\/|javascript:)/) && elem.textContent; 
    244250  } 
    245251 
     
    251257    // Anchor 
    252258    for each (let it in content.document.links) { 
    253       if (linkFilter(it)) 
     259      if (linkElementFilter(it)) 
    254260        result.push({ 
    255261          type: 'link',