如何在同一选项卡中启动具有给定 URL 的浏览器
下面是一些代码,用于使用给定的 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 技术交流群。

您可能想尝试浏览器启动器 API。
示例诺基亚论坛和 API 下载在这里。
You might like to try the Browser Launcher API instead.
Example here on Forum Nokia and API downloads are here.