Giter VIP home page Giter VIP logo

Comments (6)

JacksonGL avatar JacksonGL commented on May 27, 2024

browserInfo is mainly used for logging browser runtime information. The setPuppeteerConfig is an internal API used by MemLab core to set the puppeteer information used by the logger.

If you would like to set the executable binary of the browser, consider using the --chromium-binary CLI argument:

memlab run --scenario scenario.js --chromium-binary <path to Chrome binary>

from memlab.

HazTheGoat avatar HazTheGoat commented on May 27, 2024

Thank you for the quick reply. I tried your suggestion and this did actually make memlab use my normal chrome instead of chromium, but there is still one issue. I would expect the chrome instance to keep me logged in to my website, but it doesn't. In fact, it looks like a clean version of chrome where I'm not logged in and no addons are installed etc. I expected this to use my "normal" chrome.

Here is the exact command I used:
memlab run --scenario .\libs\shared\memlab\scenario.js --headful --chromium-binary "C:\Program Files\Google\Chrome\Application\chrome.exe"

from memlab.

JacksonGL avatar JacksonGL commented on May 27, 2024

To have chrome logged in, you can define the cookies callback in the scenario file:
https://facebook.github.io/memlab/docs/api/interfaces/core_src.IScenario/#optional-cookies

from memlab.

HazTheGoat avatar HazTheGoat commented on May 27, 2024

In the example code I provided the cookies callback is set. I can confirm that I see the cookies applied correctly by looking at my Devtools > Application > Cookies. The name and value is set correctly. The only difference I see between the cookies is that my normal chrome instance has HttpOnly set to true, Secure set to true and SameSite set to None, whereas the memlab instance of chrome doesn't have a value set for any of the above mentioned properties. I can add some screenshots to compare the two cookies.

memlab instance of chrome
image

normal instance of chrome
image

Do you know of a way for me to set those properties to match my normal chrome version of cookies?

from memlab.

JacksonGL avatar JacksonGL commented on May 27, 2024

Can you try adding httpOnly: true to the argument passed to the cookies callback?

const scenario = {
  ...
  cookies: () => [
    {name:'cookie_name', value: 'cookie_value', httpOnly: true, domain: ...},
    ...
  ],
};

from memlab.

HazTheGoat avatar HazTheGoat commented on May 27, 2024

This actually worked! I never thought to try this because of the documentation for the Cookies type defined here
https://github.com/facebook/memlab/blob/fdac330/packages/core/src/lib/Types.ts#L189

from memlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.