public BrowserAdapter5(RhoMainScreen oMainScreen, RhodesApplication app) {
    m_oMainScreen = oMainScreen;
    m_app = app;

    m_oConfig = new BrowserFieldConfig();
    //		m_oConfig.setProperty( BrowserFieldConfig.NAVIGATION_MODE,
    // BrowserFieldConfig.NAVIGATION_MODE_POINTER );
    m_oConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
    //		m_oConfig.setProperty( BrowserFieldConfig.NAVIGATION_MODE,
    // BrowserFieldConfig.NAVIGATION_MODE_CARET );
    m_oConfig.setProperty(BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);

    m_oConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
  }
  private void createBrowserField() {
    LOG.INFO("Use BrowserField5");
    m_oBrowserField = new BrowserField(m_oConfig);
    m_oBrowserField
        .getRenderingOptions()
        .setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ALLOW_POPUPS, true);
    m_oController = new RhoProtocolController(m_oBrowserField);
    m_oConfig.setProperty(BrowserFieldConfig.CONTROLLER, m_oController);

    BrowserFieldListener _listener =
        new BrowserFieldListener() {
          public void documentLoaded(BrowserField browserField, org.w3c.dom.Document document)
              throws Exception {
            synchronized (Application.getEventLock()) {
              m_oMainScreen.deleteAll();
              m_oMainScreen.add(m_oBrowserField);
            }
          }
          /*
          public void downloadProgress(BrowserField browserField,
          	 net.rim.device.api.browser.field.ContentReadEvent event)throws Exception
          {
             //Add your code here.
          }*/
        };
    m_oBrowserField.addListener(_listener);
  }
 public void setCookie(String url, String cookie) {
   // synchronized (Application.getEventLock())
   {
     BrowserFieldCookieManager man =
         (BrowserFieldCookieManager) m_oConfig.getProperty(BrowserFieldConfig.COOKIE_MANAGER);
     if (man != null) man.setCookie(url, cookie);
   }
 }