title: Python Selenium Mod Header
body: <p>I am trying to add a mod header to my firefox instance. I've looked around SO and seems like the below should be the solution but I get an error that is asking me for some kind of install file.</p>
  
  <p>I navigate to here and download the firefox mod header add in.<br>
  <a href="https://addons.mozilla.org/en-US/firefox/addon/modify-header-value/" rel="nofollow noreferrer">https://addons.mozilla.org/en-US/firefox/addon/modify-header-value/</a><br>
  Which gives me an xpi file: <strong>modify_header_value_http_headers-0.1.3-an+fx.xpi</strong></p>
  
  <pre><code>from selenium import webdriver
  
  fp = webdriver.FirefoxProfile()
  path_modify_header = '/Users/whitney_chia/Downloads/modify_header_value_http_headers-0.1.3-an+fx.xpi'
  fp.add_extension(path_modify_header)
  
  fp.set_preference("modifyheaders.headers.count", 1)
  fp.set_preference("modifyheaders.headers.action0", "Add")
  fp.set_preference("modifyheaders.headers.name0", "MyHeaderName") # Set here the name of the header
  fp.set_preference("modifyheaders.headers.value0", "MyHeaderValue") # Set here the value of the header
  fp.set_preference("modifyheaders.headers.enabled0", True)
  fp.set_preference("modifyheaders.config.active", True)
  fp.set_preference("modifyheaders.config.alwaysOn", True)
  
  driver = webdriver.Firefox(firefox_profile=fp)
  driver.get("MyURL")
  </code></pre>
  
  <p>The error I get is the below:    </p>
  
  <pre><code>AddonFormatError: ("[Errno 2] No such file or directory: 'C:\\\\Users\\\\WHITNE~1\\\\AppData\\\\Local\\\\Temp\\\\tmp0ou6fmws.modify_header_value_http_headers-0.1.3-an+fx.xpi\\\\install.rdf'", &lt;traceback object at 0x000000000676D588&gt;)
  </code></pre>
  
  <p>It seems to be looking for an "install.rdf" within the .xpi file. Any ideas what I'm doing wrong? The .xpi file is like a zip file from what I've read, do I need to unzip it first? Even then I don't see an install.rdf in it.</p>
  
  <p>Thanks as always!</p>