2021-12-10 02:37:01 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google LLC All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
|
*/
|
|
|
|
|
|
2024-01-26 00:31:57 +00:00
|
|
|
import {NgModule, NgZone} from '@angular/core';
|
|
|
|
|
import {MatSelect} from '@angular/material/select';
|
2021-12-09 05:44:17 +00:00
|
|
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
2024-01-19 21:52:14 +00:00
|
|
|
import {ApplicationEnvironment, ApplicationOperations, DevToolsComponent} from 'ng-devtools';
|
2020-01-27 18:40:18 +00:00
|
|
|
|
2021-12-09 05:44:17 +00:00
|
|
|
import {AppComponent} from './app.component';
|
|
|
|
|
import {ChromeApplicationEnvironment} from './chrome-application-environment';
|
|
|
|
|
import {ChromeApplicationOperations} from './chrome-application-operations';
|
2024-01-26 00:31:57 +00:00
|
|
|
import {ZoneAwareChromeMessageBus} from './zone-aware-chrome-message-bus';
|
|
|
|
|
import {Events, MessageBus, PriorityAwareMessageBus} from 'protocol';
|
2024-01-26 00:35:36 +00:00
|
|
|
import {FrameManager} from '../../../../projects/ng-devtools/src/lib/frame_manager';
|
2020-01-27 18:40:18 +00:00
|
|
|
|
|
|
|
|
@NgModule({
|
2020-02-07 21:25:16 +00:00
|
|
|
declarations: [AppComponent],
|
2024-01-26 00:31:57 +00:00
|
|
|
imports: [BrowserAnimationsModule, DevToolsComponent, MatSelect],
|
2020-02-07 21:09:36 +00:00
|
|
|
bootstrap: [AppComponent],
|
2020-02-07 21:25:16 +00:00
|
|
|
providers: [
|
2024-01-26 00:35:36 +00:00
|
|
|
{provide: FrameManager, useFactory: () => FrameManager.initialize()},
|
2020-02-07 21:25:16 +00:00
|
|
|
{
|
|
|
|
|
provide: ApplicationOperations,
|
|
|
|
|
useClass: ChromeApplicationOperations,
|
|
|
|
|
},
|
2020-04-02 23:23:03 +00:00
|
|
|
{
|
|
|
|
|
provide: ApplicationEnvironment,
|
|
|
|
|
useClass: ChromeApplicationEnvironment,
|
|
|
|
|
},
|
2024-01-26 00:31:57 +00:00
|
|
|
{
|
|
|
|
|
provide: MessageBus,
|
|
|
|
|
useFactory(ngZone: NgZone): MessageBus<Events> {
|
|
|
|
|
const port = chrome.runtime.connect({
|
|
|
|
|
name: '' + chrome.devtools.inspectedWindow.tabId,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return new PriorityAwareMessageBus(new ZoneAwareChromeMessageBus(port, ngZone));
|
|
|
|
|
},
|
|
|
|
|
deps: [NgZone],
|
|
|
|
|
},
|
2020-02-07 21:25:16 +00:00
|
|
|
],
|
2020-01-27 18:40:18 +00:00
|
|
|
})
|
2024-01-16 21:35:47 +00:00
|
|
|
export class AppModule {}
|