@@ -103,18 +103,13 @@ function BlackboxLogViewer() {
103
103
playbackRate = PLAYBACK_DEFAULT_RATE ,
104
104
105
105
graphZoom = GRAPH_DEFAULT_ZOOM ,
106
- lastGraphZoom = GRAPH_DEFAULT_ZOOM , // QuickZoom function.
107
- currentWindowId ;
108
-
109
- if ( chrome . windows ) {
110
- chrome . windows . getCurrent ( function ( currentWindow ) {
111
- currentWindowId = currentWindow . id ;
112
- } ) ;
113
- }
106
+ lastGraphZoom = GRAPH_DEFAULT_ZOOM ; // QuickZoom function.
114
107
115
108
function createNewBlackboxWindow ( fileToOpen ) {
109
+ var timestampId = Date . now ( ) ;
116
110
chrome . app . window . create ( 'index.html' ,
117
111
{
112
+ 'id' : "main" + timestampId ,
118
113
'innerBounds' : {
119
114
'width' : INNER_BOUNDS_WIDTH ,
120
115
'height' : INNER_BOUNDS_HEIGHT
@@ -1959,21 +1954,20 @@ function BlackboxLogViewer() {
1959
1954
1960
1955
// All the windows opened try to open the new blackbox,
1961
1956
// so we limit it to one of them, the first in the list for example
1962
- chrome . windows . getAll ( function ( windows ) {
1957
+ var windows = chrome . app . window . getAll ( ) ;
1958
+ var firstWindow = windows [ 0 ] ;
1959
+ var currentWindowId = chrome . app . window . current ( ) . id ;
1963
1960
1964
- var firstWindow = windows [ 0 ] ;
1961
+ if ( currentWindowId == firstWindow . id ) {
1962
+ var filePathToOpenExpression = / .* " ( [ ^ " ] * ) " $ / ;
1963
+ var fileToOpen = path . match ( filePathToOpenExpression ) ;
1965
1964
1966
- if ( currentWindowId == firstWindow . id ) {
1967
- var filePathToOpenExpression = / .* " ( [ ^ " ] * ) " $ / ;
1968
- var fileToOpen = path . match ( filePathToOpenExpression ) ;
1969
-
1970
- if ( fileToOpen . length > 1 ) {
1971
- var fullPathFile = fileToOpen [ 1 ] ;
1972
- createNewBlackboxWindow ( [ fullPathFile ] ) ;
1973
- }
1965
+ if ( fileToOpen . length > 1 ) {
1966
+ var fullPathFile = fileToOpen [ 1 ] ;
1967
+ createNewBlackboxWindow ( [ fullPathFile ] ) ;
1974
1968
}
1969
+ }
1975
1970
1976
- } ) ;
1977
1971
} ) ;
1978
1972
} catch ( e ) {
1979
1973
// Require not supported, chrome app
0 commit comments