1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

safari fix for autofill totp and context menu options

This commit is contained in:
Kyle Spearrin 2018-01-15 23:28:07 -05:00
parent 6efcaaa584
commit 962bd24974
4 changed files with 7 additions and 2 deletions

View File

@ -86,6 +86,7 @@ export class CurrentController {
cipher: cipher, cipher: cipher,
pageDetails: this.pageDetails, pageDetails: this.pageDetails,
fromBackground: false, fromBackground: false,
doc: this.$window.document,
}).then((totpCode: string) => { }).then((totpCode: string) => {
this.$analytics.eventTrack('Autofilled'); this.$analytics.eventTrack('Autofilled');
if (totpCode && this.platformUtilsService.isFirefox()) { if (totpCode && this.platformUtilsService.isFirefox()) {

View File

@ -54,7 +54,7 @@
{{$ctrl.i18n.addLoginNotificationDesc}} {{$ctrl.i18n.addLoginNotificationDesc}}
</div> </div>
</div> </div>
<div class="list-section"> <div class="list-section" ng-if="showDisableContextMenu">
<div class="list-section-items"> <div class="list-section-items">
<div class="list-section-item list-section-item-checkbox"> <div class="list-section-item list-section-item-checkbox">
<label for="context-menu">{{$ctrl.i18n.disableContextMenuItem}}</label> <label for="context-menu">{{$ctrl.i18n.disableContextMenuItem}}</label>

View File

@ -17,6 +17,7 @@ export class OptionsController {
disableAutoTotpCopy = false; disableAutoTotpCopy = false;
disableContextMenuItem = false; disableContextMenuItem = false;
disableAddLoginNotification = false; disableAddLoginNotification = false;
showDisableContextMenu = true;
disableGa = false; disableGa = false;
i18n: any; i18n: any;
@ -25,6 +26,7 @@ export class OptionsController {
private stateService: StateService, private storageService: StorageService, private stateService: StateService, private storageService: StorageService,
public messagingService: MessagingService, private $timeout: ng.ITimeoutService) { public messagingService: MessagingService, private $timeout: ng.ITimeoutService) {
this.i18n = i18nService; this.i18n = i18nService;
this.showDisableContextMenu = !platformUtilsService.isSafari();
$timeout(() => { $timeout(() => {
PopupUtilsService.initListSectionItemListeners(document, angular); PopupUtilsService.initListSectionItemListeners(document, angular);

View File

@ -172,6 +172,7 @@ export default class AutofillService implements AutofillServiceInterface {
this.cipherService.updateLastUsedDate(options.cipher.id); this.cipherService.updateLastUsedDate(options.cipher.id);
} }
console.log('fill');
BrowserApi.tabSendMessage(tab, { BrowserApi.tabSendMessage(tab, {
command: 'fillForm', command: 'fillForm',
fillScript: fillScript, fillScript: fillScript,
@ -180,6 +181,7 @@ export default class AutofillService implements AutofillServiceInterface {
if (options.cipher.type !== CipherType.Login || totpPromise || if (options.cipher.type !== CipherType.Login || totpPromise ||
(options.fromBackground && this.platformUtilsService.isFirefox()) || options.skipTotp || (options.fromBackground && this.platformUtilsService.isFirefox()) || options.skipTotp ||
!options.cipher.login.totp || !this.tokenService.getPremium()) { !options.cipher.login.totp || !this.tokenService.getPremium()) {
console.log('return early');
return; return;
} }
@ -191,7 +193,7 @@ export default class AutofillService implements AutofillServiceInterface {
return null; return null;
}).then((code: string) => { }).then((code: string) => {
if (code) { if (code) {
UtilsService.copyToClipboard(code); UtilsService.copyToClipboard(code, options.doc);
} }
return code; return code;