MicrosoftEdge-Extensions icon indicating copy to clipboard operation
MicrosoftEdge-Extensions copied to clipboard

chrome.cookies api not working in edge extensions

Open Sarthak-ONS opened this issue 11 months ago • 2 comments

    chrome.cookies.get(
      { url: "http://localhost:3000", name: "accessToken" },
      function (cookie) {
        if (cookie) {
          console.log("Cookie value:", cookie.value);
          setCookies(cookie);
        } else {
          console.log("Cookie not found");
        }
      },
    );

chrome.cookies.get is showing undefined in Extension

Sarthak-ONS avatar Feb 05 '25 14:02 Sarthak-ONS

Hi @Sarthak-ONS, could you please provide us with your extension details and seller ID so that we can verify and assist you further?

ManikanthMSFT avatar Feb 06 '25 14:02 ManikanthMSFT

Hi @Sarthak-ONS, we are following up on your query. Could you please help us with the sample extension and confirm if your extension works on Chrome?

ManikanthMSFT avatar Feb 21 '25 06:02 ManikanthMSFT

Hi @Sarthak-ONS

I am Rahul from the Microsoft Edge Extensions Developer Support team.

Apologies for the delayed response. Could you please share your Seller ID and a sample extension where you're encountering the issue, along with screenshots of the error? This will help me verify the problem on my end and assist you further with a resolution. Also, please confirm whether your extension works on Chrome. Sharing these details will enable our internal team to better understand the specific issue and implement an effective fix as soon as possible.

  • Your Seller ID is located in the Microsoft Partner Center, specifically under:
  • Settings
  • Account Settings workspace.
  • Legal Info section.
  • Developer Tab.
  • Once you're in the Developer Tab, scroll down to the Publisher IDs section. There, you’ll find your Seller ID, along with other identifiers like User ID, Publisher ID, and Microsoft Entra tenant info. You can checkout the below link for your reference as well: Manage a commercial marketplace account in Partner Center - Partner Center | Microsoft Learn

Please let me know if you face any challenges.

Rahul-Bauri avatar Aug 04 '25 09:08 Rahul-Bauri

Hi @Sarthak-ONS

It seems the issue with your extension is that you haven't declared the cookies permission in your manifest and the host permission is missing. Could you please put the following code in your extension manifest and see if it works:

"permissions": ["cookies"], "host_permissions": ["<all_urls>"],

If the issue continues to persist, I recommend sharing your extension code with us. This will allow us to investigate the problem in detail and identify the exact cause within your code.

Rahul-Bauri avatar Aug 05 '25 14:08 Rahul-Bauri

Hi @Sarthak-ONS

Closing this issue for now as we haven’t received any response from you. If you encounter the problem again in the future, please feel free to raise a new bug so we can assist you further with the resolution.

Rahul-Bauri avatar Aug 19 '25 18:08 Rahul-Bauri