# WebExtension- chrome.extension.sendRequest is not a function

**URL:** <https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940>\
**Category:** Add-on Support\
**Created:** [September 18, 2016, 6:48am UTC](https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940 "2016-09-18T06:48:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chnprice](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@chnprice](https://discourse.mozilla.org/u/chnprice)\
**Post date:** [September 18, 2016, 6:48am UTC](https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940/1 "2016-09-18T06:48:04Z")

</div>

Hi,

I have a chrome extension and i’m going to make it to Firefox webExtension.  
But i get a error message on firefox:  
chrome.extension.sendRequest is not a function

After i google, It’s seem a bug ?  
Any suggestion?  
Thank you

By the way, I can not put a link on this post, but the tip say new user can put 5 link on the post.

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [September 18, 2016, 7:46pm UTC](https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940/2 "2016-09-18T19:46:40Z")

</div>

You should use `chrome.runtime.sendMessage` and `chrome.runtime.onMessage` for messaging. The `chrome.extension.sendRequest` method is deprecated in Chrome and thus not even implemented in Firefox.

---

<div class="post-metadata">

**Author:** ![chnprice](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@chnprice](https://discourse.mozilla.org/u/chnprice)\
**Post date:** [September 19, 2016, 1:54am UTC](https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940/3 "2016-09-19T01:54:29Z")

</div>

> [@freaktechnik](#):
>
> The chrome.extension.sendRequest method is deprecated in

Thank you , but i need to get a http requests from server,what method should I use?  
i search a lot, but can not get a answer for that, can you give me a example?

Thank you

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [September 19, 2016, 2:28am UTC](https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940/4 "2016-09-19T02:28:23Z")

</div>

You can use [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) or [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch) alike. They will be privileged and thus ignore things like CORS.

---

<div class="post-metadata">

**Author:** ![chnprice](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@chnprice](https://discourse.mozilla.org/u/chnprice)\
**Post date:** [September 21, 2016, 9:11am UTC](https://discourse.mozilla.org/t/webextension-chrome-extension-sendrequest-is-not-a-function/10940/5 "2016-09-21T09:11:09Z")

</div>

Thank you very much, it’s work for me
