Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2909)
+++ src/orca/Gecko.py	(working copy)
@@ -4370,6 +4370,10 @@
         if not obj:
             obj = orca_state.locusOfFocus
 
+        documentFrameURI = self.getDocumentFrameURI()
+        if documentFrameURI.startswith("chrome://"):
+            return False
+
         while obj:
             if obj.role == rolenames.ROLE_DOCUMENT_FRAME:
                 return True
@@ -4388,7 +4392,8 @@
         documentFrame = None
         for i in range(0, self.app.childCount):
             child = self.app.child(i)
-            if child.role == rolenames.ROLE_FRAME:
+            if child.role == rolenames.ROLE_FRAME \
+               and child.state.count(atspi.Accessibility.STATE_ACTIVE):
                 relations = child.relations
                 for relation in relations:
                     if relation.getRelationType()  \
@@ -4532,7 +4537,7 @@
                                      rolenames.ROLE_LIST_ITEM,
                                      rolenames.ROLE_MENU_ITEM]
 
-        if not structuralNavigationEnabled:
+        if not structuralNavigationEnabled or not self.inDocumentContent():
             return False
         
         if self.isAriaWidget():
@@ -4565,13 +4570,11 @@
             
     def isAriaWidget(self, obj=None):
         obj = obj or orca_state.locusOfFocus
-        
-        attrs = obj.attributes
-        if attrs is None:
-            return False
-        for attr in attrs:
-            if attr.startswith('xml-roles'):
-                return True
+        if obj and obj.attributes:
+            attrs = obj.attributes
+            for attr in attrs:
+                if attr.startswith('xml-roles'):
+                    return True
         return False
 
     def getCharacterOffsetInParent(self, obj):
