Hey everyone, I’m looking for suggestions on a simple headless browser that works well with Mono and Xamarin on Mac. I’ve already tried several options like Selenium, PhantomJS, and Awesomium, but they either have compatibility issues with Mono or are too complicated to configure properly.
My use case is pretty basic - I just need to load a webpage and extract one specific cookie value. The problem is that this cookie gets created by JavaScript, so regular HttpClient requests won’t work for me. I don’t need any fancy features like taking screenshots or DOM manipulation. Just want something that can run JavaScript and give me access to the cookies afterward.
Awesomium looked promising at first but it’s been a nightmare trying to get it working properly in my Xamarin environment. Has anyone found a reliable alternative that actually works without tons of setup hassle?
ur right, this is way simpler than it seems. webkit2gtk is a solid option on Mac with Mono. yeah, it has some dependencies, but it handles pages and JS well. cookies are easy to get after the page loads. beats the hassle of Awesomium any day!
Try CefSharp - it’s been solid for me with Xamarin projects on Mac. Way more stable than Awesomium. The Chromium backend runs JavaScript reliably, and grabbing cookies through CookieManager is pretty straightforward once the page loads. Best part? No crazy configuration like other solutions. Just grab CefSharp.Common and CefSharp.OffScreen packages, spin up a ChromiumWebBrowser instance with headless settings, and you’re good to go. Learning curve’s pretty easy if you just need cookie values after JS runs.
Been there, done that. Wasted way too much time fighting browser automation libraries just to grab a cookie value.
I ditched the local headless browser completely. Moved everything to the cloud with Latenode instead of dealing with Mac compatibility hell.
My setup: workflow loads the page, waits for JS to run, grabs the cookie, sends it back to my Xamarin app via webhook. Takes 10 minutes vs hours of dependency troubleshooting.
Best part? No browser updates, no Mono compatibility issues, no maintenance headaches. Just trigger from your app and get the cookie back. Way cleaner than managing local browsers.
have u thought about using puppeteer-sharp? it’s a .NET wrapper for headless chrome that’s pretty solid on mac. way easier than phantomJS and it handles those JS cookies just fine. setup is much simpler than with awesomium too! give it a shot!
ChromeDriver with Selenium has gotten way better for Mac Mono setups lately. I know Selenium gave you headaches before, but the newer versions nail cookie extraction. Just use ChromeOptions to run headless and set the right user data directory. After the page loads and JS runs, grab cookies straight from driver.manage().getCookies(). I’ve been doing this for similar JS cookie stuff and it’s rock solid. Just make sure your ChromeDriver version matches your Chrome install.