Hello vishal2,
You may find some useful information in this thread on the forum that FredMcD mentioned :
https://discourse.mozilla.org/t/xmlhttprequest-problem-in-firefox-extension-im-developing/34791/2
Also see [https://www.google.nl/search?authuser=1&sxsrf=ACYBGNSuB0Qm_mjtsHQokRbm62_7NANM7w%3A1568447159358&source=hp&ei=t5p8XfTbEsXcwQKsoaaYDA&q=i'm+creating+an+extension+for+mozilla%2C+i+have+to+call+api+from+that+extension+but+it+is+not+working+i'm+using+xmlhttprequest+&oq=i'm+creating+an+extension+for+mozilla%2C+i+have+to+call+api+from+that+extension+but+it+is+not+working+i'm+using+xmlhttprequest+&gs_l=psy-ab.3...958.958..2330...0.0..0.0.0.......1....2j1..gws-wiz.&ved=0ahUKEwi0k57-6M_kAhVFblAKHayQCcMQ4dUDCAU&uact=5 these search results ....]