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:
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user