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 {
RApaLs开发者_C百科Session 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?
You might like to try the Browser Launcher API instead. Example here on Forum Nokia and API downloads are here.
精彩评论