1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

refactor autofill. add auto-fill on page load

This commit is contained in:
Kyle Spearrin
2017-08-28 13:00:46 -04:00
parent c40465f292
commit ad544e5240
12 changed files with 225 additions and 111 deletions

View File

@@ -7,6 +7,14 @@
$scope.disableGa = false;
$scope.disableAddLoginNotification = false;
$scope.disableContextMenuItem = false;
$scope.disableAutoTotpCopy = false;
$scope.enableAutoFillOnPageLoad = false;
chrome.storage.local.get(constantsService.enableAutoFillOnPageLoadKey, function (obj) {
$timeout(function () {
$scope.enableAutoFillOnPageLoad = obj && obj[constantsService.enableAutoFillOnPageLoadKey] === true;
});
});
chrome.storage.local.get(constantsService.disableGaKey, function (obj) {
$timeout(function () {
@@ -145,4 +153,27 @@
});
});
};
$scope.updateAutoFillOnPageLoad = function () {
chrome.storage.local.get(constantsService.enableAutoFillOnPageLoadKey, function (obj) {
if (obj[constantsService.enableAutoFillOnPageLoadKey]) {
// disable
obj[constantsService.enableAutoFillOnPageLoadKey] = false;
}
else {
// enable
$analytics.eventTrack('Enable Auto-fill Page Load');
obj[constantsService.enableAutoFillOnPageLoadKey] = true;
}
chrome.storage.local.set(obj, function () {
$timeout(function () {
$scope.enableAutoFillOnPageLoad = obj[constantsService.enableAutoFillOnPageLoadKey];
});
if (!obj[constantsService.enableAutoFillOnPageLoadKey]) {
$analytics.eventTrack('Disable Auto-fill Page Load');
}
});
});
};
});