mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
load add fields with current tab info
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
angular
|
||||
.module('bit.current')
|
||||
|
||||
.controller('currentController', function ($scope, siteService, cipherService, tldjs, toastr, $q, $window) {
|
||||
.controller('currentController', function ($scope, siteService, cipherService, tldjs, toastr, $q, $window, $state) {
|
||||
var pageDetails = null,
|
||||
tabId = null;
|
||||
tabId = null,
|
||||
url = null,
|
||||
domain = null;
|
||||
|
||||
$scope.canAutofill = false;
|
||||
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
|
||||
var url = null;
|
||||
if (tabs.length > 0) {
|
||||
url = tabs[0].url;
|
||||
tabId = tabs[0].id;
|
||||
@@ -16,7 +18,7 @@ angular
|
||||
return;
|
||||
}
|
||||
|
||||
var domain = tldjs.getDomain(url);
|
||||
domain = tldjs.getDomain(url);
|
||||
$scope.sites = [];
|
||||
if (!domain) {
|
||||
return;
|
||||
@@ -85,6 +87,14 @@ angular
|
||||
});
|
||||
});
|
||||
|
||||
$scope.addSite = function () {
|
||||
$state.go('addSite', {
|
||||
animation: 'in-slide-up',
|
||||
name: domain,
|
||||
uri: url
|
||||
});
|
||||
};
|
||||
|
||||
$scope.fillSite = function (site) {
|
||||
var fillScript = null;
|
||||
if (site && $scope.canAutofill && pageDetails) {
|
||||
|
||||
Reference in New Issue
Block a user