使用BHO拦截URL都正常,但是如果拦截到DISPID=271的错误后,拦截会失效1次,有谁遇到过?比如说IE访问url_a 能拦截到BeforeNavigate2
这时候如果访问一个URL_XX 导致271,那么后面再
访问URL_b就拦截不到BeforeNavigate2,而只能拦截到NavigateComplete
之后访问URL_b又会拦截到BeforeNavigate2困扰了几天,郁闷...
网上没看到有这种情况的,哎...

解决方案 »

  1.   

    271 表示网址访问出错 不知道你在收到271后做了什么处理,比如将
    NavigateError(ASender: TObject; const pDisp: IDispatch;
      var URL, Frame, StatusCode: OleVariant; var Cancel: WordBool);
    中URL转向到URL_b那么肯定不会触发BeforeNavigate2   ASender
      Object   expression   that   resolves   to   the   objects   in   the   Applies   To   list.     
      pDisp   
      Object   that   evaluates   to   the   top-level   or   frame   WebBrowser   object   corresponding   to   the   failed   navigation.   
      URL   
      String   expression   that   evaluates   to   the   URL   for   which   navigation   failed.   
      Frame
      String   that   evaluates   to   the   name   of   the   frame   in   which   the   resource   is   to   be   displayed,   or   Null   if   no   named   frame   is   targeted   for   the   resource.     
      StatusCode   
      Integer   that   contains   a   status   code   corresponding   to   the   error,   if   available.   For   a   list   of   the   possible   status   codes,   see   NavigateError   Event   Status   Codes.   
      Cancel   
      Boolean   that   specifies   whether   to   cancel   the   navigation   to   an   error   page   and/or   any   further   autosearch.