# How to send a variables from a main code (index) to HTML's content script?

**URL:** <https://discourse.mozilla.org/t/how-to-send-a-variables-from-a-main-code-index-to-htmls-content-script/16025>\
**Category:** Development\
**Created:** [June 1, 2017, 7:47pm UTC](https://discourse.mozilla.org/t/how-to-send-a-variables-from-a-main-code-index-to-htmls-content-script/16025 "2017-06-01T19:47:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user123](https://avatars.discourse-cdn.com/v4/letter/u/ed655f/32.png) [@user123](https://discourse.mozilla.org/u/user123)\
**Post date:** [June 1, 2017, 7:47pm UTC](https://discourse.mozilla.org/t/how-to-send-a-variables-from-a-main-code-index-to-htmls-content-script/16025/1 "2017-06-01T19:47:05Z")

</div>

I need an SDK extension to open an HTML page (safe-HTML which is stored in the data folder of the extension). This HTML needs to access a variable in the addon. How can I transfer the variable from the addon to the HTML?  
In the panel, I could do that using port.emit and port.on but this requires the panel’s object in the addon,something like: `myPanel.port.emit( ... )`. Unlike the panel, the HTML page does not have object created int he addon. How can I allow the HTML page’s content script to receive a variable from the addon?
