2019-01-25 16:04:21 +01:00
|
|
|
import 'core-js/es7/reflect';
|
|
|
|
|
2018-04-04 04:14:54 +02:00
|
|
|
import { enableProdMode } from '@angular/core';
|
|
|
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
2018-04-11 16:57:34 +02:00
|
|
|
import 'web-animations-js';
|
2018-04-04 04:14:54 +02:00
|
|
|
|
|
|
|
// tslint:disable-next-line
|
2018-04-11 04:20:50 +02:00
|
|
|
require('./scss/popup.scss');
|
2018-04-04 04:14:54 +02:00
|
|
|
|
2018-09-30 04:58:36 +02:00
|
|
|
import { BrowserApi } from '../browser/browserApi';
|
2019-08-21 18:24:51 +02:00
|
|
|
|
2018-04-04 04:14:54 +02:00
|
|
|
import { AppModule } from './app.module';
|
|
|
|
|
2018-04-13 21:14:04 +02:00
|
|
|
if (process.env.ENV === 'production') {
|
|
|
|
enableProdMode();
|
|
|
|
}
|
2018-04-04 04:14:54 +02:00
|
|
|
|
2018-10-01 19:22:05 +02:00
|
|
|
function init() {
|
2018-09-30 14:25:56 +02:00
|
|
|
if (BrowserApi.isEdge18) {
|
2018-10-01 19:22:05 +02:00
|
|
|
const inPopup = window.location.search === '' || window.location.search.indexOf('uilocation=') === -1 ||
|
|
|
|
window.location.search.indexOf('uilocation=popup') > -1;
|
|
|
|
if (inPopup) {
|
|
|
|
const bodyRect = document.querySelector('body').getBoundingClientRect();
|
|
|
|
chrome.windows.create({
|
|
|
|
url: 'popup/index.html?uilocation=popout',
|
|
|
|
type: 'popup',
|
2018-12-03 17:16:26 +01:00
|
|
|
width: Math.round(bodyRect.width + 60),
|
|
|
|
height: Math.round(bodyRect.height),
|
2018-10-01 19:22:05 +02:00
|
|
|
});
|
|
|
|
BrowserApi.closePopup(window);
|
|
|
|
return;
|
|
|
|
}
|
2018-09-30 14:25:56 +02:00
|
|
|
}
|
2018-10-01 19:22:05 +02:00
|
|
|
|
|
|
|
platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true });
|
2018-09-30 04:58:36 +02:00
|
|
|
}
|
2018-10-01 19:22:05 +02:00
|
|
|
|
|
|
|
init();
|