From 815ef17d02e8b4ef6f4b3baad1a3e4433843194b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 3 Oct 2018 08:26:46 -0400 Subject: [PATCH] adjustments for edge 18 workarounds --- src/browser/browserApi.ts | 8 +------- src/popup/app.component.ts | 2 +- src/popup/components/pop-out.component.ts | 4 ++-- src/popup/scss/base.scss | 6 ++++++ src/popup/tabs.component.html | 4 ++-- src/popup/tabs.component.ts | 17 +++++++++++++++-- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index 39daacf781..d90c61a1d4 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -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 { 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; diff --git a/src/popup/app.component.ts b/src/popup/app.component.ts index b0687ea38f..f14102a0e4 100644 --- a/src/popup/app.component.ts +++ b/src/popup/app.component.ts @@ -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() { diff --git a/src/popup/components/pop-out.component.ts b/src/popup/components/pop-out.component.ts index a03716bd37..2464ef8989 100644 --- a/src/popup/components/pop-out.component.ts +++ b/src/popup/components/pop-out.component.ts @@ -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)) { diff --git a/src/popup/scss/base.scss b/src/popup/scss/base.scss index 11ed3b7ca9..0639685fe7 100644 --- a/src/popup/scss/base.scss +++ b/src/popup/scss/base.scss @@ -329,6 +329,12 @@ header { } } } + + &.tabs-3 { + ul li { + width: 33.33%; + } + } } app-root { diff --git a/src/popup/tabs.component.html b/src/popup/tabs.component.html index 013324c169..ba5fc42678 100644 --- a/src/popup/tabs.component.html +++ b/src/popup/tabs.component.html @@ -1,8 +1,8 @@
-