Problem


michie4life

Still Fresh
Joined
Nov 30, 2009
Messages
75
Age
29
Location
Lelystad, Netherlands
Hello,


I'am trying to find out how to embed chrome/chromium/webkit into an C++ application.


I searched the internet but didn't succeed.


So, does anybody know how to do this?


Thanks in advance :)


EDIT: It's for a Pandora app. :p
 
Last edited by a moderator:
Easiest way: use Qt and QWebView. Of course this is not an option if you're not using Qt :)


EDIT: typo
 
Last edited by a moderator:
Might I ask, even though you've said you're switching to Qt:


Why do you need to 'embed' Chrome/Webkit?


Can't you do something like



Code:
void launchWeb(char * where){ //launches firefox (EDIT: I mean chrome!)

   char buf[100]="chrome ";//don't actually do this! Plus use absolute path

   strcat(buf,where); //use strncat instead, too

   if(!fork())system(buf); //system is bad but we're all on the same system

}



If you're actually making your game in javascript/etc, do NOT write a launcher in C/C++ - just call chrome. Use a shell script.



Code:
#!/bin/sh

/usr/bin/chrome www.losethegame.com

replace /usr/bin/chrome with the actual path to chrome, and www.losethegame.com with the path to the web game (local or over http)
 
Last edited by a moderator:
Might I ask, even though you've said you're switching to Qt:


Why do you need to 'embed' Chrome/Webkit?


Can't you do something like



Code:
void launchWeb(char * where){  //launches firefox (EDIT: I mean chrome!)

   char buf[100]="chrome ";    //don't actually do this! Plus use absolute path

   strcat(buf,where);          //use strncat instead, too

   if(!fork())system(buf);     //system is bad but we're all on the same system

}



If you're actually making your game in javascript/etc, do NOT write a launcher in C/C++ - just call chrome. Use a shell script.



Code:
#!/bin/sh

/usr/bin/chrome www.losethegame.com

replace /usr/bin/chrome with the actual path to chrome, and www.losethegame.com with the path to the web game (local or over http)

I'm fairly new to this, so...


Does this launch chrome in a new window or inside the "window".
 
^ there is no window.


That shellscript would just load chrome with the javascript you want.
 
Back
Top