views:

208

answers:

1

I've tried various permutations of:

firefox.exe "javascript:document.location='http://site.com';document.cookies='key=val';"

But with no good result; the cookie is not added for the site.com domain. Is it at all possible to accomplish using this approach?

+1  A: 

It is not going to happen doing anything like that. The JavaScript will not happen in a synchronous manner which is a good thing or we would have security problems. Try greasemonkey

epascarello
Grease monkey is really not a prefered solution in this case, ideally I'd like a generic way to launch "the default browser" with a session cookie I've previously retrieved with my web scraper program. This appers really hard to accomplish, so perhaps I can settle on just firefox (but w/o need to install custom Add-ons like grease monkey)... I know that there are tools like Selenium, but would prefer a more light weight solution, perhaps writing out a magic .js file to disk and open the browser on it?