1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +00:00

Revert "Safari Web Extension Port from App Extension"

This commit is contained in:
Chad Scharf
2021-01-13 17:08:33 -05:00
committed by GitHub
parent ebd2439edd
commit 336f8f3117
47 changed files with 1950 additions and 664 deletions

View File

@@ -58,12 +58,13 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
// ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1562620
this.initU2f = false;
}
const isSafari = this.platformUtilsService.isSafari();
await super.ngOnInit();
if (this.selectedProviderType == null) {
return;
}
if (this.selectedProviderType === TwoFactorProviderType.Email &&
if (!isSafari && this.selectedProviderType === TwoFactorProviderType.Email &&
this.popupUtilsService.inPopup(window)) {
const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('popup2faCloseMessage'),
null, this.i18nService.t('yes'), this.i18nService.t('no'));

View File

@@ -185,6 +185,8 @@ export const routerTransition = trigger('routerTransition', [
transition('tabs => premium', inSlideLeft),
transition('premium => tabs', outSlideRight),
transition('tabs => lock', inSlideDown),
]);
if (!BrowserApi.isSafariApi) {
routerTransition.definitions.push(transition('tabs => lock', inSlideDown));
}

View File

@@ -1,4 +1,4 @@
<ng-container>
<ng-container *ngIf="show">
<button (click)="expand()" appA11yTitle="{{'popOutNewWindow' | i18n}}">
<i class="fa fa-external-link fa-rotate-270 fa-lg fa-fw" aria-hidden="true"></i>
</button>

View File

@@ -22,7 +22,8 @@ export class PopOutComponent implements OnInit {
ngOnInit() {
if (this.show) {
if (this.popupUtilsService.inSidebar(window) && this.platformUtilsService.isFirefox()) {
this.show = !this.platformUtilsService.isSafari();
if (this.show && this.popupUtilsService.inSidebar(window) && this.platformUtilsService.isFirefox()) {
this.show = false;
}
}

View File

@@ -68,6 +68,8 @@ export class PopupUtilsService {
chrome.tabs.create({
url: href,
});
} else if ((typeof safari !== 'undefined')) {
// Safari can't open popup in full page tab :(
}
}
}

View File

@@ -96,7 +96,7 @@
</div>
<div class="box-footer">{{'disableChangedPasswordNotificationDesc' | i18n}}</div>
</div>
<div class="box">
<div class="box" *ngIf="showDisableContextMenu">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="context-menu">{{'disableContextMenuItem' | i18n}}</label>

View File

@@ -29,6 +29,7 @@ export class OptionsComponent implements OnInit {
disableChangedPasswordNotification = false;
dontShowCards = false;
dontShowIdentities = false;
showDisableContextMenu = true;
showClearClipboard = true;
theme: string;
themeOptions: any[];
@@ -67,6 +68,8 @@ export class OptionsComponent implements OnInit {
}
async ngOnInit() {
this.showDisableContextMenu = !this.platformUtilsService.isSafari();
this.enableAutoFillOnPageLoad = await this.storageService.get<boolean>(
ConstantsService.enableAutoFillOnPageLoadKey);

View File

@@ -1,5 +1,5 @@
<header>
<div class="left">
<div class="left" *ngIf="showLeftHeader">
<app-pop-out [show]="!inSidebar"></app-pop-out>
<button type="button" appBlurClick (click)="refresh()" appA11yTitle="{{'refresh' | i18n}}" *ngIf="inSidebar">
<i class="fa fa-retweet fa-lg fa-fw" aria-hidden="true"></i>

View File

@@ -49,6 +49,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
hostname: string;
searchText: string;
inSidebar = false;
showLeftHeader = false;
searchTypeSearch = false;
loaded = false;
@@ -67,7 +68,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
}
async ngOnInit() {
this.searchTypeSearch = !this.platformUtilsService.isSafari();
this.showLeftHeader = this.searchTypeSearch = !this.platformUtilsService.isSafari();
this.inSidebar = this.popupUtilsService.inSidebar(window);
this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => {

View File

@@ -1,5 +1,5 @@
<header>
<div class="left">
<div class="left" *ngIf="showLeftHeader">
<app-pop-out></app-pop-out>
</div>
<div class="search">

View File

@@ -92,7 +92,8 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
async ngOnInit() {
this.searchTypeSearch = !this.platformUtilsService.isSafari();
this.showLeftHeader = !(this.popupUtils.inSidebar(window) && this.platformUtilsService.isFirefox());
this.showLeftHeader = !this.platformUtilsService.isSafari() &&
!(this.popupUtils.inSidebar(window) && this.platformUtilsService.isFirefox());
this.stateService.remove('CiphersComponent');
this.broadcasterService.subscribe(ComponentId, (message: any) => {