1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

Merge pull request #1491 from Hinton/feature/safari-webext

Safari Web Extension Port from App Extension
This commit is contained in:
Chad Scharf
2021-01-13 16:23:09 -05:00
committed by GitHub
47 changed files with 663 additions and 1949 deletions

View File

@@ -58,13 +58,12 @@ 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 (!isSafari && this.selectedProviderType === TwoFactorProviderType.Email &&
if (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,8 +185,6 @@ export const routerTransition = trigger('routerTransition', [
transition('tabs => premium', inSlideLeft),
transition('premium => tabs', outSlideRight),
]);
if (!BrowserApi.isSafariApi) {
routerTransition.definitions.push(transition('tabs => lock', inSlideDown));
}
transition('tabs => lock', inSlideDown),
]);

View File

@@ -1,4 +1,4 @@
<ng-container *ngIf="show">
<ng-container>
<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,8 +22,7 @@ export class PopOutComponent implements OnInit {
ngOnInit() {
if (this.show) {
this.show = !this.platformUtilsService.isSafari();
if (this.show && this.popupUtilsService.inSidebar(window) && this.platformUtilsService.isFirefox()) {
if (this.popupUtilsService.inSidebar(window) && this.platformUtilsService.isFirefox()) {
this.show = false;
}
}

View File

@@ -68,8 +68,6 @@ 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" *ngIf="showDisableContextMenu">
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="context-menu">{{'disableContextMenuItem' | i18n}}</label>

View File

@@ -29,7 +29,6 @@ export class OptionsComponent implements OnInit {
disableChangedPasswordNotification = false;
dontShowCards = false;
dontShowIdentities = false;
showDisableContextMenu = true;
showClearClipboard = true;
theme: string;
themeOptions: any[];
@@ -68,8 +67,6 @@ 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" *ngIf="showLeftHeader">
<div class="left">
<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,7 +49,6 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
hostname: string;
searchText: string;
inSidebar = false;
showLeftHeader = false;
searchTypeSearch = false;
loaded = false;
@@ -68,7 +67,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
}
async ngOnInit() {
this.showLeftHeader = this.searchTypeSearch = !this.platformUtilsService.isSafari();
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" *ngIf="showLeftHeader">
<div class="left">
<app-pop-out></app-pop-out>
</div>
<div class="search">

View File

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