@@ -37,30 +37,42 @@ SeleniumIDE.Loader.getTopEditor = function() {
37
37
38
38
SeleniumIDE . Loader . getEditors = function ( ) {
39
39
var editors = [ ] ;
40
- if ( document ) {
41
- var sidebarBox = document . getElementById ( 'sidebar-box' ) ;
42
- if ( sidebarBox && ! sidebarBox . hidden ) {
43
- var sidebar = document . getElementById ( 'sidebar' ) ;
44
- try {
45
- if ( sidebar && sidebar . contentDocument ) {
46
- if ( "chrome://selenium-ide/content/selenium-ide-sidebar.xul" == sidebar . contentDocument . documentURI ) {
47
- var sidebarView = sidebar . contentDocument . defaultView ;
48
- if ( sidebarView && sidebarView . editor ) {
49
- editors . push ( sidebarView . editor ) ;
50
- }
51
- }
52
- }
53
- } catch ( error ) {
54
- }
55
- }
40
+ var editor = this . getSidebarEditor ( document ) ;
41
+ if ( editor ) {
42
+ editors . push ( editor ) ;
56
43
}
57
44
var wm = Components . classes [ "@mozilla.org/appshell/window-mediator;1" ] . getService ( Components . interfaces . nsIWindowMediator ) ;
58
45
var editorWindow = wm . getMostRecentWindow ( 'global:selenium-ide' ) ;
59
46
if ( editorWindow && editorWindow . editor ) {
60
47
editors . push ( editorWindow . editor ) ;
61
48
}
49
+ var mainWindow = wm . getMostRecentWindow ( "navigator:browser" ) ;
50
+ editor = this . getSidebarEditor ( mainWindow . document ) ;
51
+ if ( editor ) {
52
+ editors . push ( editor ) ;
53
+ }
62
54
return editors ;
63
- }
55
+ } ;
56
+
57
+ SeleniumIDE . Loader . getSidebarEditor = function ( doc ) {
58
+ if ( doc ) {
59
+ var sidebarBox = doc . getElementById ( 'sidebar-box' ) ;
60
+ if ( sidebarBox && ! sidebarBox . hidden ) {
61
+ var sidebar = doc . getElementById ( 'sidebar' ) ;
62
+ try {
63
+ if ( sidebar && sidebar . contentDocument ) {
64
+ if ( "chrome://selenium-ide/content/selenium-ide-sidebar.xul" == sidebar . contentDocument . documentURI ) {
65
+ var sidebarView = sidebar . contentDocument . defaultView ;
66
+ if ( sidebarView && sidebarView . editor ) {
67
+ return sidebarView . editor ;
68
+ }
69
+ }
70
+ }
71
+ } catch ( error ) {
72
+ }
73
+ }
74
+ }
75
+ } ;
64
76
65
77
SeleniumIDE . Loader . reloadRecorder = function ( contentWindow , isRootDocument ) {
66
78
var editors = this . getEditors ( ) ;
0 commit comments