title: FireFox InvalidAccessError: A parameter or an operation is not supported by the underlying object
body: <p>Hi I have a really odd problem. We have a lot of users in our application and a single user is experiencing an issue I cannot replicate on any other machine (I've tested 7 machines, 2 Win10, 5 Macbooks, in both FF 42 and FF ESR).</p>
  
  <p>InvalidAccessError: A parameter or an operation is not supported by the underlying object</p>
  
  <pre><code>getRule: function( aSelector ) {
      var rules = ( this._rules.cssRules ) ? this._rules.cssRules : this._rules.rules,
          rule = false,
          i, len;
  
      try {
          for ( i = 0, len = rules.length; i &lt; len; i++ ) {
              if ( rules[ i ] &amp;&amp; rules[ i ].selectorText == aSelector ) {
                  rule = rules[ i ];
                  break;
              }
          }
      } catch( ex ) { }
  
      return rule;
  },
  </code></pre>
  
  <p>How I'm creating the stylesheet:</p>
  
  <pre><code>    this._container = document.createElement( 'style' );
      this._container.setAttribute( 'type', 'text/css' );
      this._container.setAttribute( 'rel', 'stylesheet' );
      this._container.setAttribute( 'media', 'all' );
  
      document.getElementsByTagName( 'head' )[ 0 ].appendChild( this._container );
      this._rules = document.styleSheets[ document.styleSheets.length - 1 ];
  </code></pre>
  
  <p>When it tries to access rules.length that error shows up but only for this one person. The CSS rules I'm accessing are rules I'm dynamically generating including the stylesheet tag itself (same domain so not a CORS issue).</p>
  
  <p>Originally I didn't have the try/catch and adding it didn't help. During testing this user did have NoScript installed which is what I thought was the problem but they have since removed it. They said they've tested multiple machines and it happens on them all but I can't replicate it on any machine I've tried.</p>
  
  <p>What else could cause this message? Are there any browser settings that could cause this? Or addons? I've asked them to uninstall all addons and refresh FireFox and neither helped.</p>