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,
pageDetails: this.pageDetails,
fromBackground: false,
doc: this.$window.document,
}).then((totpCode: string) => {
this.$analytics.eventTrack('Autofilled');
if (totpCode && this.platformUtilsService.isFirefox()) {

View File

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

View File

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

View File

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