如何在同一选项卡中启动具有给定 URL 的浏览器

发布于 2024-08-27 08:03:53 字数 979 浏览 3 评论 0原文

下面是一些代码,用于使用给定的 URL 启动 S60 浏览器。

  // use the StartDocument api
  param->Des().Format( _L( "4 %S" ),&aUrl );
  TUid id( TUid::Uid( browserUid ) );
  TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
  TApaTask task = taskList.FindApp( id );
  if ( task.Exists() ) {
    HBufC8* param8 = HBufC8::NewL( param->Length() );
    param8->Des().Append( *param );
    task.SendMessage( TUid::Uid( 0 ), *param8 ); 
    // Uid is not used // CleanupStack::PopAndDestroy(); // param8
  }
  else {
    RApaLsSession appArcSession;
    User::LeaveIfError( appArcSession.Connect() ); // connect to AppArc server
    TThreadId id;
    appArcSession.StartDocument( *param, TUid::Uid(browserUid), id );
    appArcSession.Close();
  }

然而,这似乎为每个 URL 打开一个新选项卡,如果选项卡数量达到内部 WebKit 限制 (5),则会引发错误,表示已达到弹出窗口的最大数量。 有什么解决方法吗?是否可以在同一选项卡中打开本机 S60 浏览器?

Here is some code to launch S60 browser with a given url.

  // use the StartDocument api
  param->Des().Format( _L( "4 %S" ),&aUrl );
  TUid id( TUid::Uid( browserUid ) );
  TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
  TApaTask task = taskList.FindApp( id );
  if ( task.Exists() ) {
    HBufC8* param8 = HBufC8::NewL( param->Length() );
    param8->Des().Append( *param );
    task.SendMessage( TUid::Uid( 0 ), *param8 ); 
    // Uid is not used // CleanupStack::PopAndDestroy(); // param8
  }
  else {
    RApaLsSession appArcSession;
    User::LeaveIfError( appArcSession.Connect() ); // connect to AppArc server
    TThreadId id;
    appArcSession.StartDocument( *param, TUid::Uid(browserUid), id );
    appArcSession.Close();
  }

However, this seems to open a new tab for each URL, and if number of tabs reaches internal WebKit limit (5), it will raise an error, saying that maximum number of pop-up windows have been reached.
Is there any workaround for this? Is it possible to open the native S60 browser within the same one tab?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野侃 2024-09-03 08:03:53

您可能想尝试浏览器启动器 API。
示例诺基亚论坛和 API 下载在这里

You might like to try the Browser Launcher API instead.
Example here on Forum Nokia and API downloads are here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文