搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Unable to set user preference on launching browser through codeceptjs

  • 無回覆
  • 0 有這個問題
  • 9 次檢視
more options

I have created a test profile and added the below line in prefs.js file user_perf("network.cookie.cookieBehavior",0);

Below is the desiredCapabilities section for codecept config file. desiredCapabilities: {

       moz:firefoxOptions: {
         args: ['--ignore-certificate-errors', '-headless', '-profile', '/path/to/my/testProfile']
       },

}

When the browser is launched it creates a temporary profile where my network cookie behavior change is not reflected and also the browser is not headless.

To set the network cookie behavior value to 0 I also used the below desiredCapabilities which also didn't work. desiredCapabilities: {

       moz:firefoxOptions: {
        args: ['--ignore-certificate-errors', '-headless', '-profile', '/path/to/my/testProfile'],
        prefs: { "network.cookie.cookieBehavior": 0 }
       },

}

I have created a test profile and added the below line in prefs.js file user_perf("network.cookie.cookieBehavior",0); Below is the desiredCapabilities section for codecept config file. desiredCapabilities: { moz:firefoxOptions: { args: ['--ignore-certificate-errors', '-headless', '-profile', '/path/to/my/testProfile'] }, } When the browser is launched it creates a temporary profile where my network cookie behavior change is not reflected and also the browser is not headless. To set the network cookie behavior value to 0 I also used the below desiredCapabilities which also didn't work. desiredCapabilities: { moz:firefoxOptions: { args: ['--ignore-certificate-errors', '-headless', '-profile', '/path/to/my/testProfile'], prefs: { "network.cookie.cookieBehavior": 0 } }, }

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題