# Getting cookies from a devtools panel

**URL:** <https://discourse.mozilla.org/t/getting-cookies-from-a-devtools-panel/19116>\
**Category:** Development\
**Created:** [September 12, 2017, 4:12pm UTC](https://discourse.mozilla.org/t/getting-cookies-from-a-devtools-panel/19116 "2017-09-12T16:12:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marius\_Gundersen](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/marius_gundersen/32/22808_2.png) [@Marius\_Gundersen](https://discourse.mozilla.org/u/Marius_Gundersen)\
**Post date:** [September 12, 2017, 4:12pm UTC](https://discourse.mozilla.org/t/getting-cookies-from-a-devtools-panel/19116/1 "2017-09-12T16:12:02Z")

</div>

I’m having trouble creating a new devtools panel and having it list the cookies in the page. I have managed to show a panel, pretty much copying the [devtools-panel](https://github.com/mdn/webextensions-examples/tree/master/devtools-panels) example, and I have managed to list cookies, by copying the [list-cookies](https://github.com/mdn/webextensions-examples/tree/master/list-cookies) example. But, if I try to use the `browser.cookies` api from a devtool panel, I get `undefined`. What do I need to do to access the extension api from a devtool panel?

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [September 12, 2017, 11:57pm UTC](https://discourse.mozilla.org/t/getting-cookies-from-a-devtools-panel/19116/2 "2017-09-12T23:57:40Z")

</div>

> **[Extending the developer tools](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Extending_the_developer_tools#Working_with_content_scripts)**
>
> You can use WebExtensions APIs to extend the browser's built-in developer tools. To create a devtools extension, include the " devtools\_page " key in manifest.json :

See the [Working with content scripts](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Extending_the_developer_tools#Working_with_content_scripts) section. I think the same applies to all/most other `browser.*` APIs.
