File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,19 @@ export class WebPanelController {
104
104
return this . webPanel . getCurrentUrl ( ) ;
105
105
}
106
106
107
+ hackAsyncTabSwitcher ( ) {
108
+ const tabBrowser = this . webPanel . getTabBrowser ( ) ;
109
+ tabBrowser . _printPreviewBrowsers . add ( this . webPanel . getXUL ( ) ) ;
110
+ }
111
+
112
+ unhackAsyncTabSwitcher ( ) {
113
+ const tabBrowser = this . webPanel . getTabBrowser ( ) ;
114
+ tabBrowser . _printPreviewBrowsers . delete ( this . webPanel . getXUL ( ) ) ;
115
+ }
116
+
107
117
initWebPanel ( ) {
118
+ this . hackAsyncTabSwitcher ( ) ;
119
+
108
120
this . webPanel . listenBrowserProgressListener ( ( ) => {
109
121
this . webPanel . setZoom ( this . webPanel . zoom ) ;
110
122
if ( this . webPanel . isActive ( ) ) {
@@ -175,6 +187,7 @@ export class WebPanelController {
175
187
}
176
188
177
189
unload ( ) {
190
+ this . unhackAsyncTabSwitcher ( ) ;
178
191
this . sidebarController . close ( ) ;
179
192
this . webPanel . remove ( ) ;
180
193
this . webPanelTab . remove ( ) ;
@@ -333,6 +346,7 @@ export class WebPanelController {
333
346
}
334
347
335
348
remove ( ) {
349
+ this . unhackAsyncTabSwitcher ( ) ;
336
350
this . webPanel . remove ( ) ;
337
351
this . webPanelTab . remove ( ) ;
338
352
this . webPanelButton . remove ( ) ;
Original file line number Diff line number Diff line change @@ -166,13 +166,6 @@ export class WebPanelsController {
166
166
delete ( uuid ) {
167
167
const index = this . getIndex ( uuid ) ;
168
168
if ( index !== - 1 ) {
169
- const webPanelController = this . get ( uuid ) ;
170
- const webPanel = webPanelController . webPanel ;
171
-
172
- // Revert hack to deceive AsyncTabSwitcher
173
- const tabBrowser = webPanel . getTabBrowser ( ) ;
174
- tabBrowser . _printPreviewBrowsers . delete ( webPanel . getXUL ( ) ) ;
175
-
176
169
delete this . webPanelControllers [ uuid ] ;
177
170
}
178
171
}
@@ -292,11 +285,6 @@ export class WebPanelsController {
292
285
unloadOnClose ,
293
286
hideToolbar ,
294
287
) ;
295
-
296
- // Hack to deceive AsyncTabSwitcher
297
- const tabBrowser = webPanel . getTabBrowser ( ) ;
298
- tabBrowser . _printPreviewBrowsers . add ( webPanel . getXUL ( ) ) ;
299
-
300
288
return webPanel ;
301
289
}
302
290
You can’t perform that action at this time.
0 commit comments