title: Opera: security error when trying to read value from script storage
body: <p>I'm writing a user JS script for Opera, and I'm trying to use window.opera.scriptStorage to store and retrieve values.</p>
  
  <p>I have created a type called __EnvDriver to encapsulate the script storage.</p>
  
  <pre><code>window.__EnvDriver.storage = window.opera.scriptStorage;
  if(window.__EnvDriver.storage == undefined)
  {
      console.log('[__EnvDriver] Opera UserJS script storage seems to be disabled. Please set the quota to a non-zero value in opera:config.');
  }
  
  window.__EnvDriver.storageGetValue = function(key)
  {
      return window.__EnvDriver.storage[key];
  };
  
  window.__EnvDriver.storageSetValue = function(key, value)
  {
      window.__EnvDriver.storage[key] = value;
  };
  </code></pre>
  
  <p>(The functions othe __EnvDriver type are determined at runtime, to easily implement support for Firefox or Chrome in the future.)</p>
  
  <p>I can store values without problem, but when trying to read a value, I get the following error:</p>
  
  <pre><code>Uncaught exception: ReferenceError: Security error: attempted to read protected variable
  Error thrown at line 45, column 2 in &lt;anonymous function: window.__EnvDriver.storageGetValue&gt;(key):
      return window.__EnvDriver.storage[key];
  </code></pre>
  
  <p>The problem seems to be with accessing the <code>window.__EnvDriver.storage</code> value, as the same error occurs when I try to use it in any way. I tried storing the storage object in different places, but all of them show the same behavior. This seem to have been occurring only since the very latest Opera update (v12.01).</p>
  
  <p>Any help would be greatly appreciated.</p>