adjustments for edge 18 workarounds

This commit is contained in:
Kyle Spearrin 2018-10-03 08:26:46 -04:00
parent adb3dc78ee
commit 815ef17d02
6 changed files with 27 additions and 14 deletions

View File

@ -6,7 +6,6 @@ export class BrowserApi {
static isFirefoxOnAndroid: boolean = navigator.userAgent.indexOf('Firefox/') !== -1 &&
navigator.userAgent.indexOf('Android') !== -1;
static isEdge18: boolean = navigator.userAgent.indexOf(' Edge/18.') !== -1;
static backgroundPageCache: any = null;
static async getTabFromCurrentWindowId(): Promise<any> {
if (BrowserApi.isChromeApi) {
@ -135,12 +134,7 @@ export class BrowserApi {
}
static getBackgroundPage(): any {
if (BrowserApi.isEdge18) {
if (BrowserApi.backgroundPageCache == null) {
BrowserApi.backgroundPageCache = browser.extension.getBackgroundPage();
}
return BrowserApi.backgroundPageCache;
} else if (BrowserApi.isChromeApi) {
if (BrowserApi.isChromeApi) {
return chrome.extension.getBackgroundPage();
} else if (BrowserApi.isSafariApi) {
return safari.extension.globalPage.contentWindow;

View File

@ -138,7 +138,7 @@ export class AppComponent implements OnInit {
}
getState(outlet: RouterOutlet) {
return outlet.activatedRouteData.state;
return BrowserApi.isEdge18 ? null : outlet.activatedRouteData.state;
}
private async recordActivity() {

View File

@ -56,8 +56,8 @@ export class PopOutComponent implements OnInit {
chrome.windows.create({
url: href,
type: 'popup',
width: bodyRect.width + 60,
height: bodyRect.height,
width: bodyRect.width ? bodyRect.width + 60 : 375,
height: bodyRect.height || 600,
});
if (this.popupUtilsService.inPopup(window)) {

View File

@ -329,6 +329,12 @@ header {
}
}
}
&.tabs-3 {
ul li {
width: 33.33%;
}
}
}
app-root {

View File

@ -1,8 +1,8 @@
<div class="tab-page">
<router-outlet></router-outlet>
<nav class="tabs">
<nav class="tabs" [ngClass]="{'tabs-3': !showCurrentTab}">
<ul>
<li routerLinkActive="active">
<li routerLinkActive="active" *ngIf="showCurrentTab">
<a routerLink="current" title="{{'currentTab' | i18n}}">
<i class="fa fa-folder fa-2x"></i>{{'tab' | i18n}}
</a>

View File

@ -1,7 +1,20 @@
import { Component } from '@angular/core';
import {
Component,
OnInit,
} from '@angular/core';
import { PopupUtilsService } from './services/popup-utils.service';
@Component({
selector: 'app-tabs',
templateUrl: 'tabs.component.html',
})
export class TabsComponent { }
export class TabsComponent implements OnInit {
showCurrentTab: boolean = true;
constructor(private popupUtilsService: PopupUtilsService) { }
ngOnInit() {
this.showCurrentTab = !this.popupUtilsService.inPopout(window);
}
}