-1

I'm getting this error

Timestamp: 4/2/12 11:56:36 AM
Error: uncaught exception: 
   [Exception... "Component returned failure code: 0x80040111 
   (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindow.localStorage]"  
   nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  
   location: "JS frame :: chrome://myextension/content/users.js 
   :: startFBP :: line 6"  data: no]

My files:

chrome.manifest

content myextension chrome/content/
content myextension chrome/content/ contentaccessible=yes
overlay chrome://browser/content/browser.xul chrome://myextension/content/tracker.xul

install.rdf

<?xml version="1.0" encoding="UTF-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:id>firefox@myextension.fourbananas</em:id>
    <em:version>2.0</em:version>
    <em:type>2</em:type>

    <!-- Target Application this extension can install into, 
         with minimum and maximum supported versions. --> 
    <em:targetApplication>
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>1.5</em:minVersion>
        <em:maxVersion>13.0.*</em:maxVersion>
      </Description>
    </em:targetApplication>

    <!-- Front End MetaData -->
    <em:name>myextension</em:name>
    <em:description>My Extension! Una extensión que te permite añadir funciones únicas a tus redes sociales</em:description>
    <em:creator>Four Bananas</em:creator>
    <em:homepageURL>http://myextension.me/</em:homepageURL>
  </Description>      
</RDF>
Luis
  • 1,067
  • 1
  • 14
  • 25
  • 2
    Please do check this `location: "JS frame :: chrome://myextension/content/users.js ` – linguini Apr 02 '12 at 20:17
  • 1
    There is something wrong at line no 6 in the JS page. If you think some component problem then try to update your FF & check it out. – linguini Apr 03 '12 at 04:17
  • 1
    The exception clearly says that the error is in file `users.js`, function `startFBP`. So why are you quoting `install.rdf` and `chrome.manifest` that are entirely unrelated to the problem instead of quoting the code where the error happens? Also, please mention in which context this code runs - the browser window? – Wladimir Palant Apr 03 '12 at 08:07

1 Answers1

3

Even though there is almost no useful information in the question, the exception indicates that there is an error accessing window.localStorage. My psychic powers tell me that you are attempting to access window.localStorage in a document loaded from chrome://, probably the browser window's XUL document. This will not work: localStorage is always bound to a server host name, meaning that you only have it for documents loaded from http://.

In an extension you can use different mechanisms to store data persistently, most common being preferences.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126