Show
Ignore:
Timestamp:
08/06/08 18:07:41 (4 months ago)
Author:
anekos
Message:

getComputedStyle を使うように修正。

Files:
1 modified

Legend:

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

    r17111 r17166  
    3535//        (次|前)っぽいURIを捏造してそこに移動します。 
    3636// 
     37//    example: 
     38//      :js liberator.globalVariables.autoDetectLink = {nextPatterns: [/next/, /次/]} 
     39// 
    3740//  Function: 
    3841//    (次|前)へのリンクを検出する。 
     
    4144//      setting:  設定を一時的に上書きする。省略可。 
    4245//      return:   リンクのURIなどを含んだオブジェクト 
    43 //        uri:    アドレス。 
    44 //        text:   リンクテキストなど。 
    45 //        frame:  リンクの存在するフレームの Window オブジェクト。 
     46//        uri:     アドレス。 
     47//        text:    リンクテキストなど 
     48//        frame:   リンクの存在するフレームの Window オブジェクト 
     49//        element: リンクの要素 
    4650// 
    4751//    (次|前)へのリンクに移動。 
     
    241245  // 要素が表示されているか? 
    242246  function isVisible (element) { 
    243     return !(element.style && element.style.display.match(/none/)) && (!element.parentNode || isVisible(element.parentNode)) 
     247    try { 
     248      let st = content.document.defaultView.getComputedStyle(element, null); 
     249      return !(st.display && st.display.match(/none/)) && (!element.parentNode || isVisible(element.parentNode)) 
     250    } catch { 
     251      return true; 
     252    } 
    244253  } 
    245254